Prerequisites
Quick Start — Tool Runner
The Anthropic Python SDK includes atool_runner that handles the tool-calling loop automatically. Define Nimble tools with the @beta_tool decorator and the SDK manages execution, message history, and retries.
Python
Messages API (Manual Loop)
For more control, define tools using the Anthropicinput_schema format and handle the tool_use → tool_result loop manually.
1. Define the Tool Schema
Python
2. Handle the Tool-Use Loop
Python
Node.js Example
Node
How It Works
The Anthropic tool-use flow has three steps:1
Send tools and message
Pass the tool definitions and user message to Claude. If Claude decides to use a tool, it returns a
tool_use content block with the tool name and input.2
Execute the tool
Parse the
tool_use block and call the corresponding Nimble SDK method. Return the result as a tool_result message.3
Get the final answer
Claude processes the tool result and responds with a text answer. If it needs more data, it may call another tool — the loop continues until
stop_reason is end_turn.Available Tools
Any Nimble SDK method can be exposed as an Anthropic tool. Here are the most common ones:Next Steps
Python SDK
Full Python SDK reference — all methods and configuration options
Node SDK
Full Node.js SDK reference with TypeScript support
Search
Web search with depth levels, filtering, and AI answers
OpenAI
Use Nimble with OpenAI function calling and the Agents SDK