Open
Description
Is your feature request related to a problem? Please describe.
I experimented with the SDK and found a strange behavior. Tools without inputSchema
are not visible in Cursor and Claude Desktop, but work fine in Visual Studio Code. Here is my fix to make them available everywhere:
let tool = Tool(name: "swift_version",
description: "Returns the current Swift version",
inputSchema: .object([
"type": .string("object")
]))
Here is a full code if my example:
https://github.com/artemnovichkov/swift-version-mcp/blob/master/Sources/SwiftVersionMCP/main.swift
I'm not sure is this problem related to the SDK or to the clients.
Describe the solution you'd like
If you want to use the tool without inputSchema
, it may be configured like:
let tool = Tool(name: "swift_version",
description: "Returns the current Swift version")
Activity
stallent commentedon Apr 17, 2025
In their defense, input schema isn't optional for tools per the spec. So i'm not sure this is something that should be changed. From the spec:
I certainly get how without params whats the point, but spec interpretation is always somewhat subjective which is why you are seeing diff behavior from diff tools. Regardless, the spec does say optional for optional things so pretty reasonable to assume its required which is why it doesn't work in Claude Desktop especially, since they created the spec.