| name | anth-core-workflow-a |
| description | Build Claude tool use (function calling) workflows with the Messages API.
Use when implementing tool use, function calling, agent loops,
or building AI assistants that interact with external systems.
Trigger with phrases like "claude tool use", "anthropic function calling",
"claude tools", "agent loop anthropic", "tool_use blocks".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Grep |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","ai","anthropic"] |
| compatibility | Designed for Claude Code |
Anthropic Core Workflow A — Tool Use (Function Calling)
Overview
Implement Claude's tool use capability where the model can call functions you define. Claude returns tool_use content blocks with structured JSON inputs; your code executes the function and returns tool_result blocks. This is the foundation for building AI agents.
Prerequisites
- Completed
anth-install-auth setup
- Understanding of the Messages API request/response cycle
- Functions or APIs you want Claude to call
Instructions
Step 1: Define Tools
import anthropic
client = anthropic.Anthropic()
tools = [
{
"name": "get_weather",
"description": "Get current weather for a city. Use when the user asks about weather conditions.",
"input_schema": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "City name, e.g. 'San Francisco, CA'"
},
"units": {
"type": "string",
"enum": ["celsius", "fahrenheit"],
"description": "Temperature units"
}
},
"required": ["city"]
}
},
{
"name": "search_database",
"description": "Search product database by query string. Returns matching products.",
"input_schema": {
"type": "object",
: {
: {: },
: {: , : }
},
: []
}
}
]