anthropics / anthropics/ClaudeForFoundationModels

Expose allowed_callers and user_location on ClaudeServerTool

Abierto
#28 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Swift
Estrellas
292
Forks
30
Merge medio
23 min
PR fusionados (30 d)
4

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.