toolbroker-claude-agent
Claude Agent SDK adapter for ToolBroker.
pip install toolbroker-claude-agent
from claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient
from toolbroker import ToolBroker
from toolbroker_claude_agent import ClaudeAgentAdapter
broker = ToolBroker()
broker.add_functions([search_orders, issue_refund, check_inventory])
broker.index()
adapter = ClaudeAgentAdapter()
selection = broker.select("customer wants a refund", k=3)
options = ClaudeAgentOptions(
mcp_servers={"tools": adapter.create_server(selection.tools)},
allowed_tools=adapter.allowed_tool_names(selection.tools, server="tools"),
)
render() returns SdkMcpTool objects; create_server() wraps them into the in-process
MCP server config the SDK expects.
Why allowed_tool_names exists
The SDK gates tools by name in the form mcp__<server>__<tool>. Getting that string
wrong means the model sees the tool and is then refused permission to call it — a
confusing failure. The helper builds the names from the same selection, so the two
cannot drift apart.
Result shape
Handlers must return MCP content blocks. Anything your function returns is wrapped
automatically: a dict that already has content passes through untouched, and
everything else becomes a single text block. Override with result_formatter= if you
need image or resource blocks.
Metadata
Release files for toolbroker-claude-agent 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| toolbroker_claude_agent-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / toolbroker_claude_agent-0.1.0-py3-none-any.whl
| Download URL | toolbroker_claude_agent-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b672baf4d8163ba96cf735a1476536c555d7c062299141cbfe5ca0ef5e0c7f18
|
|
BLAKE2b-256 checksum How to use checksums |
e80bc67037fb6a10b6f2270b758908301416d36c5b1522872da59be37b6e6e50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|