AI agents and MCP

Stage 2 · Lesson 6 of 7

Descriptions and result size

Tool calling from scratch

Most tool-calling failures are the wrong tool or wrong arguments, and both are usually fixed in the tool description rather than the . Write descriptions as you would for a new teammate: what the tool does, when to use it, when not to, what it returns and any limits.

State formats explicitly, such as dates as YYYY-MM-DD in the store's time zone. Keep results small too. Every result stays in the conversation for the rest of the run, so return only the fields the model needs, a page of results with a way to fetch more, and readable names rather than internal ids.

Common trapreturning a five-thousand-row result and hoping the model finds the one row it needs, which costs money on every later step and buries the facts that matter.

A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

  • GuideFree
    Claude Tool Use Documentation

    Anthropic · Intermediate

    Read Overview, Define tools and Handle tool calls, then follow the tutorial that grows one call into a full loop

  • GuideFree
    OpenAI Function Calling Guide

    OpenAI · Intermediate

    The same loop on the Responses API: read it after your first provider to see what is universal

Practise

  • Free notebooks: work through the tool use course, which builds tools and a loop exercise by exercise

  • Runnable function-calling examples to compare with your own loop

Keep handy

Also worth your time

Mark this stage as not done?