From 73e9ef494bdfdbf085390d70679ae4e83a58a953 Mon Sep 17 00:00:00 2001 From: Alexander von Below Date: Wed, 26 Nov 2025 00:14:06 +0100 Subject: [PATCH] Add type descriptions to InputSchema, and adjust format to current specification This allows tools like mcpInspector to list the tools --- README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ac23a4c3..cbc772bc 100644 --- a/README.md +++ b/README.md @@ -433,10 +433,14 @@ await server.withMethodHandler(ListTools.self) { _ in Tool( name: "weather", description: "Get current weather for a location", - inputSchema: .object([ + inputSchema`: .object([ + "type": .string("object"), "properties": .object([ - "location": .string("City name or coordinates"), - "units": .string("Units of measurement, e.g., metric, imperial") + "location": .object([ + "description": .string("City name or coordinates"), + "type": .string("string"), + "units": .string("Units of measurement, e.g., metric, imperial") + ]) ]) ]) ), @@ -444,8 +448,12 @@ await server.withMethodHandler(ListTools.self) { _ in name: "calculator", description: "Perform calculations", inputSchema: .object([ + "type": .string("object"), "properties": .object([ - "expression": .string("Mathematical expression to evaluate") + "expression": .object([ + "type": .string("string"), + "description": .string("Mathematical expression to evaluate") + ]) ]) ]) ) @@ -886,4 +894,4 @@ see the [GitHub Releases page](https://github.com/modelcontextprotocol/swift-sdk This project is licensed under the MIT License. [mcp]: https://modelcontextprotocol.io -[mcp-spec-2025-03-26]: https://modelcontextprotocol.io/specification/2025-03-26 \ No newline at end of file +[mcp-spec-2025-03-26]: https://modelcontextprotocol.io/specification/2025-03-26