diff --git a/src/tools/BaseTool.ts b/src/tools/BaseTool.ts index 3103747..53ab1f1 100644 --- a/src/tools/BaseTool.ts +++ b/src/tools/BaseTool.ts @@ -51,6 +51,7 @@ export abstract class MCPTool = {}> abstract name: string; abstract description: string; protected abstract schema: ToolInputSchema; + protected useStringify: boolean = true; [key: string]: unknown; get inputSchema(): { type: "object"; properties?: Record } { @@ -127,7 +128,10 @@ export abstract class MCPTool = {}> } return { - content: [{ type: "text", text: JSON.stringify(data) }], + content: [{ + type: "text", + text: this.useStringify ? JSON.stringify(data) : String(data) + }], }; }