Is the README example Tool registration method incorrect?
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- swift
- 领域
- api, documentation
调研方向
Start with the README Tool registration example and compare its inputSchema with the object schema shown in the issue. Check the Swift Tool API to determine which form is accepted, then update the README example to match the working registration format and verify the documented example is consistent with the API.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Is the README example Tool registration method incorrect?
Using the example from the README, I get an error saying that the inputSchema is expected to be an object.
Example from the README:
Tool(
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")
])
)
When I try this format, I get the expected response:
Tool(
name: "weather",
description: "Get current weather for a location",
inputSchema: .object([
"type": "object",
"properties": [
"a": ["type": "number"],
"b": ["type": "number"]
],
"required": ["a", "b"]
])
)
To Reproduce
Steps to reproduce the behavior:
1.
Expected behavior
A clear and concise description of what you expected to happen.
Logs
If applicable, add logs to help explain your problem.
Additional context
Add any other context about the problem here.
- 主要语言
- Swift
- 星标
- 1.6k
- 派生
- 270
- 平均合并
- 2 天 7 小时
- 30 天内合并 PR
- 15
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/swift-sdk 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 73/100
modelcontextprotocol/swift-sdk#327 ·
维护者通常 2 天内回复
-
Value decoding changes data-URL-looking JSON strings into Value.data可能已有人在做 @bitbemol 于 73 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
modelcontextprotocol/swift-sdk#277 ·
维护者通常 2 天内回复
-
enhancement
难度 1/5 1 小时以内 新手友好度 78/100
modelcontextprotocol/swift-sdk#274 ·
维护者通常 2 天内回复
-
`HTTPClientTransport` fails to build on Windows: `#if !os(Linux)` guards no longer match the `EventSource` platform condition可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
modelcontextprotocol/swift-sdk#261 ·
维护者通常 2 天内回复
-
Client.withBatch leaves per-request tasks pending when transport.send throws可能已有人在做 @bbdu3 于 1 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
modelcontextprotocol/swift-sdk#324 · 2 条评论 · 1 个 reaction ·
维护者通常 2 天内回复
查看 modelcontextprotocol/swift-sdk 的全部 Issue
相似的 Issue
-
🎉 Add Ginkgo可能已有人在做 @usual2970 今天认领。 未关闭addition
难度 1/5 1 小时以内 新手友好度 76/100
jaywcjlove/awesome-mac#4442 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
DeveloperAcademy-POSTECH/2026-C6-A03-KIIKICK-iOS#76 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 91/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100
VictorKildahl/cra#302 · 1 条评论 ·
维护者通常 1 天内回复