Skip to content

Commit 32b4b22

Browse files
committed
Updated to use PromptParameterSchema
1 parent e0ba083 commit 32b4b22

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

tools/Mcp/src/services/promptsService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { z, ZodRawShape } from "zod";
2-
import { promptSchema, toolParameterSchema } from "../types.js";
2+
import { promptSchema, promptParameterSchema } from "../types.js";
33
import { CodegenServer } from "../CodegenServer.js";
44

55

@@ -64,7 +64,7 @@ export class PromptsService {
6464
return response;
6565
}
6666

67-
createPromptParametersFromSchema(schemas: toolParameterSchema[]) {
67+
createPromptParametersFromSchema(schemas: promptParameterSchema[]) {
6868
const parameter: { [k: string]: any } = {};
6969
for (const schema of schemas) {
7070
const base = schema.optional ? z.any().optional() : z.any();

tools/Mcp/src/types.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
export interface toolParameterSchema {
22
name: string;
33
description: string;
4-
type: string; // string | number | boolean | array (of string)
5-
optional?: boolean; // if true, parameter is optional
4+
type: string;
5+
}
6+
7+
export interface promptParameterSchema {
8+
name: string;
9+
description: string;
10+
type: string;
11+
optional?: boolean;
612
}
713

814
export interface toolSchema {
@@ -15,8 +21,8 @@ export interface toolSchema {
1521
export interface promptSchema {
1622
name: string;
1723
description: string;
18-
parameters: toolParameterSchema[]; // reuse parameter schema
19-
callbackName: string; // maps to PromptService internal function
24+
parameters: promptParameterSchema[];
25+
callbackName: string;
2026
}
2127

2228
export interface responseSchema {

0 commit comments

Comments
 (0)