anthropics / anthropics/ClaudeForFoundationModels

Expose allowed_callers and user_location on ClaudeServerTool

Offen
#28 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Swift
Sterne
292
Forks
30
Ø Merge
23 Min.
Gemergte PRs (30 T.)
4

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.