[DOCS] Missing required `code-execution` beta header in Programmatic Tool Calling Quick Start examples
Documentation Type
Missing documentation (feature not documented)
Documentation Location
https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling
Section/Topic
The Quick start section containing the code examples for Bash, Python, and TypeScript.
Current Documentation
In the Python example tab:
response = client.beta.messages.create(
model="claude-sonnet-4-5",
betas=["advanced-tool-use-2025-11-20"],
max_tokens=4096,
# ...
tools=[
{
"type": "code_execution_20250825",
"name": "code_execution"
},
# ...
]
)
In the Bash example tab:
--header "anthropic-beta: advanced-tool-use-2025-11-20" \
What's Wrong or Missing?
The examples utilize the code_execution_20250825 tool type. However, the API request only includes the advanced-tool-use-2025-11-20 beta header.
If a user runs this code as written, the API will reject the request because the code-execution-2025-08-25 beta header is missing. The Code Execution tool cannot be used without its specific beta header enabled, regardless of whether it is being used for Programmatic Tool Calling.
Suggested Improvement
Update the code snippets in the Quick Start section (Bash, Python, and TypeScript) to include both required beta headers.
For Python:
Change:betas=["advanced-tool-use-2025-11-20"],
To:betas=["advanced-tool-use-2025-11-20", "code-execution-2025-08-25"],
For Bash:
Change:--header "anthropic-beta: advanced-tool-use-2025-11-20" \
To:--header "anthropic-beta: advanced-tool-use-2025-11-20,code-execution-2025-08-25" \
For TypeScript:
Change:betas: ["advanced-tool-use-2025-11-20"],
To:betas: ["advanced-tool-use-2025-11-20", "code-execution-2025-08-25"],
Impact
High - Prevents users from using a feature
Additional Context
- Without this fix, the "Quick start" code is not copy-paste runnable and will result in an API error.
- Reference for Code Execution header requirement: https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗