anthropics / anthropics/ClaudeForFoundationModels
Expose allowed_callers and user_location on ClaudeServerTool
- Ngôn ngữ chính
- Swift
- Star
- 292
- Fork
- 30
- Merge trung bình
- 23 phút
- Pull request đã merge (30 ngày)
- 4
Mô tả
Two gaps in ClaudeServerTool's web-search/web-fetch config, found while auditing whether our app's search setup is ZDR-compliant:
1. allowed_callers is unreachable from app code.
ClaudeServerTool.webSearch/.webFetch ([ClaudeServerTool.swift] (/SourcePackages/checkouts/ClaudeForFoundationModels/Sources/ClaudeForFoundationModels/ClaudeServerTool.swift)) hardcode web_search_20260209/web_fetch_20260209, whose allowed_callers defaults to ["code_execution_20260120"] — i.e. dynamic filtering, which your own docs mark as not ZDR-eligible even though the base tools are. The documented opt-out is allowed_callers: ["direct"], but there's no way to send it: ClaudeServerTool's config(domains:maxUses:) builder is private, and ToolDefinition.config is package-scoped. Any app requiring ZDR is stuck on the non-eligible path for these tools with no workaround.
Ask: expose allowed_callers as a parameter on .webSearch/.webFetch, or let callers select the basic (non-dynamic-filtering) tool versions (web_search_20250305/web_fetch_20250910) directly.
2. user_location isn't exposed at all.
The Messages API's web search tool accepts user_location (city/region/country/timezone) to localize results, but ClaudeServerTool.webSearch only accepts domains:/maxUses:. For a client-side app that knows the device's locale/timezone, there's no way to pass it through.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.