Messages API
Treat an API interaction as a request, response and error path. Inspect message content and usage information before building a longer conversation.
Tool use and agent loop
The model proposes a tool call; your application executes the tool. Validate its inputs, return the result and stop the loop when the task is complete.
Context management
Keep only relevant context and track request usage. Establish a maximum number of tool steps and handle unavailable tools without silently repeating requests.
Practice assignment
Implement or trace a read-only calculator tool, showing the request, validated arguments, tool result and final answer.
Completion checklist
- Explain the three topics in your own words.
- Complete the assignment and keep the output or design notes.
- Test an edge case and record one limitation.