anthropics / anthropics/ClaudeForFoundationModels

Expose allowed_callers and user_location on ClaudeServerTool

Open
#28 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
292
Forks
30
Avg merge
23m
Merged PRs (30d)
4

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.