anthropics / anthropics/ClaudeForFoundationModels

Expose allowed_callers and user_location on ClaudeServerTool

Aperta
#28 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Swift
Stelle
292
Fork
30
Merge medio
23m
PR unite (30g)
4

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.