AI agents and MCP

Stage 2 · Lesson 1 of 7

Defining tools

Tool calling from scratch

A has three parts: a name, a description and a for its arguments. JSON Schema is a standard way to describe the shape of JSON, listing each field, its type and which fields are required. You send the definitions with every request, and they are all the model knows about your tools.

Anthropic calls the schema input_schema and OpenAI calls it parameters, but the idea is the same. Give each tool one clear job, a name that says the action, such as search_orders, and a few typed arguments. Use enums (fixed lists of allowed values) for choices such as order status.

Common trapone vague tool such as query(text) that does five jobs, which the model will call at the wrong time with the wrong arguments.

A question to check yourself, an AI practice session and 1 cheat sheet entry 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?