From 23e307a7a94784e4d383c8ce041b20b31b3a3ab7 Mon Sep 17 00:00:00 2001 From: "Peter.Morton" Date: Sun, 22 Mar 2026 12:43:54 -0500 Subject: [PATCH] fix: tools/list handler now returns proper tool metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: The registerTool method was receiving description and inputSchema parameters but marking them as unused (_description, _inputSchema) and not storing them with the handler. This caused tools/list to return tools without their description and inputSchema properties. Fix: Remove underscore prefixes and explicitly set these properties on the handler object before storing it in the tools Map. Now tools/list will properly return: - name: Tool name - description: Tool description (from registerTool call) - inputSchema: Tool input schema (from registerTool call) This ensures MCP clients can see proper tool documentation and schemas. Files changed: - src/server.ts: Fixed registerTool to preserve metadata Build: ✅ 0 errors Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/server.ts | 8 ++++++-- src/tools/search.ts | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/server.ts b/src/server.ts index 7ade8d8..79f6bc7 100644 --- a/src/server.ts +++ b/src/server.ts @@ -42,10 +42,14 @@ export class ObsidianMCPServer { */ registerTool( name: string, - _description: string, - _inputSchema: Record, + description: string, + inputSchema: Record, handler: ToolHandler ): void { + // Ensure handler has description and inputSchema + handler.description = description; + handler.inputSchema = inputSchema; + this.tools.set(name, handler); logger.debug('Registered tool', { name }); } diff --git a/src/tools/search.ts b/src/tools/search.ts index 408ce66..5621ccf 100644 --- a/src/tools/search.ts +++ b/src/tools/search.ts @@ -20,7 +20,7 @@ export async function registerSearchTools(server: ObsidianMCPServer): Promise