Tool use (function calling) — giving Claude the ability to take actions, not just talk.
A task manager agent that uses tools to add, list, and complete tasks. Tasks persist to tasks.json in this folder. Type exit to end the conversation.
tool_choice — defaults to "auto", letting Claude decide when a tool is needed. Alternatives: force a specific tool, force any tool, or disable tools entirely.is_error: true so Claude can react appropriately instead of the program crashing.main()) that keeps the conversation going across turns, and an inner loop (in run_turn()) that resolves any tool calls within a single turn before returning.tasks.json), not just pure functions.From the repo root:
pip install -r requirements.txt
export ANTHROPIC_API_KEY=your-key-here
python3 Core_Architecture/tool_use/basic_agentic_tools.py
Try prompts like:
You: Add a task to buy groceries, due tomorrow
You: What tasks do I have open?
You: Mark that task as done
Edit the constants at the top of basic_agentic_tools.py:
MODEL — the Claude model used (default: claude-sonnet-5)MAX_TOKENS — max response lengthEFFORT — thinking/response depth (default: medium)SYSTEM_PROMPT — instructions that shape Claude’s behavior as the assistantTOOLS — the JSON Schema tool definitions Claude can callTASKS_FILE — where tasks are persisted (default: tasks.json next to the script)../../Execution_Loops/agentic_loop/basic_agentic_loop.py — the outer chat loop this template’s main() follows../../Agent_Frameworks_and_Patterns/tool_registry/basic_tool_registry.py — a scalable alternative to this file’s hand-maintained TOOLS list + if/elif dispatch../agent/README.md — this same tool-calling loop shape, repurposed for unattended goal pursuit instead of turn-by-turn chat../../Tools_and_Actions/README.md — server-side and Anthropic-defined client-side tools, building on this custom client-side pattern