GlossaryTool calling
Tool calling
Tool calling is the way an AI model asks a program to run a named action with structured inputs, such as running a design rule check on a board file, and then reads what the tool returns. It is how a model goes from describing an action to taking one.
How it works
The application tells the model which tools exist. Each tool has a name, a description and an input schema, usually written in JSON Schema, that defines the arguments it accepts. When the model decides a tool answers the question or advances the task, it outputs a structured request naming the tool and filling in the arguments. The application checks the request, runs the tool, and returns the output to the model, which reads it and decides what to do next.
The model never runs anything itself. The application decides whether a call is allowed, runs it with the permissions it has, and can ask a person to approve it first. Protocols such as MCP standardize how tools are described and called, so the same tool works across many applications. A tool can also declare an output schema, so the application can check the structured result.
The schema is the contract between the model and the tool. A part lookup tool, for example, takes a manufacturer part number as a required string and an optional quantity as a positive integer, and returns stock, price and lifecycle status. The model relies on the names and descriptions to decide when to call the tool and how to fill it, so vague descriptions cause wrong calls. Required fields, numeric ranges and enumerated values, such as a list of allowed package types, let the application reject a bad call before it runs. Structured output applies the same JSON Schema idea to the shape of the model's own answer.
Tool calling vs plain text generation
Plain generation produces an answer from what the model knows and what is in its context window. Tool calling lets the model fetch facts and take actions outside itself. A model asked for a part's stock level can only guess in plain generation. With a tool it can look it up.
Why it matters
Engineering answers are often values a tool can compute or look up: a design rule check outcome, an impedance from a field solver, stock and lifecycle for an MPN. Tool calling lets an agent get those values from the source rather than from memory, and act on files rather than only describe changes.
How to get it right
- Give each tool a clear name, a precise description and a strict input schema.
- Return structured, readable outputs, including clear error messages.
- Separate read tools from write tools, and require approval for changes, spending or anything sent outside.
- Log every call, its inputs and its output.
- Validate inputs in the tool itself, not only in the model's instructions.
Tool calling in robotics and drone hardware
The useful tools for hardware work already exist as scripts and programs: rule checkers, Gerber exporters in KiCad, parts searches, test log readers. Wrapping them as callable tools lets an agent check a BOM against stock, run a rule check after a change or pull the test and traceability record for a failed board, with every step recorded.