- Tool exposure: remove blocked tools before Anthropic sees the request.
- Tool-call check: evaluate returned
tool_useblocks before your app executes local code.
Supported Tools
The current wrapper supports user-defined client tools with a stablename. The tool type may be omitted, custom, or function.
send_email, the wrapper forwards only the remaining tools.
Tool Choice
When tools are filtered, the wrapper also sanitizestool_choice.
If the request forces a specific tool with tool_choice: { type: "tool", name: "send_email" } and Averta blocks send_email, the wrapper removes that forced choice before forwarding the request. Otherwise the request would ask Anthropic to call a tool it can no longer see.
Tool-call Checks
After Anthropic responds, the wrapper reads each returnedtool_use block:
- the tool call id from
tool_use.id - the tool name from
tool_use.name - the tool arguments from
tool_use.input - bounded conversation context from the current Messages request
- the request
run_idcreated by the request checkpoint
block, the wrapper throws AvertaSdkError and does not return that response to your application. Your app should not execute the tool.
Decision Callback
Unsupported Tool Shapes
Unsupported Anthropic tool shapes fail closed before provider execution. This is deliberate. A guardrail wrapper that silently forwards unsupported tools would create false confidence.Debugging
| Symptom | Check |
|---|---|
| A tool disappeared | Inspect request decision blockedTools. |
| Forced tool choice was ignored | The forced tool may have been blocked and tool_choice sanitized. |
messages.create(...) throws before Anthropic is called | Check for unsupported tool shapes or streaming input. |
| Tool execution never starts | The returned tool_use may have been blocked by the tool-call checkpoint. |