Tool Call Syntax Rewriting
AbstractCore can preserve and rewrite tool-call syntax so downstream clients can consume tool calls consistently, even when models emit different tag formats.
Two Related Features
- Python API (
tool_call_tags): preserve/rewrite tool-call markup insideresponse.content(mostly for prompted-tool models). - HTTP Server (
agent_format): convert/synthesize tool-call syntax for HTTP clients while keepingtool_callsstructured. - Canonical representation: use structured
tool_callsfor execution; rewriting is formatting, not execution.
2) HTTP Server: agent_format
When using the OpenAI-compatible server (/v1/chat/completions), request a target syntax format with agent_format.
Important: The server runs in passthrough mode by default (execute_tools=false): it returns tool calls; it does not execute them.
Supported values
auto(default): auto-detect usingUser-Agent+ model patternsopenai,codex,qwen3,llama3,xml,gemma,passthrough
Example (curl)
curl -sS http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "ollama/qwen3:4b-instruct",
"messages": [{"role": "user", "content": "Weather in Paris?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather for a city",
"parameters": {"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}
}
}],
"agent_format": "codex"
}'
See also: Server Guide for endpoint details and provider/model naming.
Notes
tool_call_tagsandagent_formatare formatting controls, not tool execution.- Use
response.tool_calls(Python) ormessage.tool_calls(server/OpenAI format) as the canonical tool-call representation.