Update inputSchema example usage (#136)

* Update Tool inputSchema in README example usage

* Update inputSchema usage in Tool tests
This commit is contained in:
Mattt 2025-06-12 02:57:04 -07:00 • committed by GitHub
commit 36865fb056
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -434,15 +434,19 @@ server.withMethodHandler(ListTools.self) { _ in
name: "weather",
description: "Get current weather for a location",
inputSchema: .object([
"location": .string("City name or coordinates"),
"units": .string("Units of measurement, e.g., metric, imperial")
"properties": .object([
"location": .string("City name or coordinates"),
"units": .string("Units of measurement, e.g., metric, imperial")
])
])
),
Tool(
name: "calculator",
description: "Perform calculations",
inputSchema: .object([
"expression": .string("Mathematical expression to evaluate")
"properties": .object([
"expression": .string("Mathematical expression to evaluate")
])
])
)
]