1.4 KiB
1.4 KiB
2026-05-12 — Claude Tool Adapter
Summary
The local Gateway Companion now has a bounded Anthropic tool-use adapter for Claude Code traffic.
What Changed
- Anthropic request
toolsare rendered into a strict instruction for the text backend. - OpenAI-style tool calls and compact JSON tool decisions are converted into Anthropic
tool_useblocks. - Forced
tool_choice: {type:"tool"}returns a validtool_useblock even when the text backend returns an empty response. - Streaming tool use emits Anthropic-compatible SSE:
message_startcontent_block_startcontent_block_deltawithinput_json_deltacontent_block_stopmessage_deltamessage_stop
Verification
- Non-stream synthetic request:
- Tool:
read_file - Result:
content[0].type=tool_use - Input:
{"path":"/tmp/hello.txt"}
- Tool:
- Streaming synthetic request:
- Tool:
read_file - Result:
input_json_delta - Input:
{"path":"/tmp/stream.txt"}
- Tool:
- Claude Code CLI smoke after the change still reached the Gateway and produced dashboard rows for
claude-code-companion.
Boundary
The Erik claude-bridge remains text-only and calls claude --print --output-format text. Native hosted Anthropic tool-use parity is not complete. The adapter now transports and synthesizes tool blocks for forced tool calls, but autonomous tool selection still depends on the text backend following the JSON tool instruction.