LyraLearn AI Learning Platform
Exams
← Module 7 Β· Tool Calling
🎧 Listen

Designing Good Tools

A tool the model can't understand is a tool the model won't use β€” or worse, will use wrongly. The model chooses which tool to call, and with what arguments, based entirely on the names, descriptions, and schemas you give it. Tool design is therefore prompt engineering in a structured costume: every word counts.

Contrast diagram showing one confusing do-everything tool versus three small clearly described tools that the model can pick between with confidence.

Name and describe for the reader (the model)

Treat each tool's metadata as documentation written for a smart colleague who has never seen your codebase:

Define parameters with strict schemas

Each tool's parameters are a JSON schema, and the model fills it in. Make the schema do the work:

  1. Type everything precisely β€” integer, string, enum for fixed choices. An enum of ["active", "withdrawn", "completed"] is far safer than a free-text status.
  2. Mark required vs. optional fields so the model knows what it must supply.
  3. Describe each field, including units and format: "dueDate: ISO-8601 date, e.g. 2026-09-01". The model reads these descriptions when populating arguments.
  4. Keep parameters minimal. Fewer, well-named fields mean fewer chances to get it wrong.

In .NET with Semantic Kernel, you express this with [KernelFunction] and [Description] attributes on a C# method and its parameters; the framework generates the JSON schema the model sees. Your method signature is the contract.

Keep tools small and composable

Prefer several focused tools over one do-everything tool with a mode flag. A small tool is easier for the model to choose correctly, easier for you to validate, and easier to test. One tool, one job. And don't overwhelm the model β€” a handful of relevant, well-described tools outperforms thirty vaguely-named ones, because every extra tool is another chance to pick wrong.

A useful gut check: read only your tool names and descriptions, with no other context. If you can't tell which tool fits a given request, the model can't either. LyraLearn's content-ingestion tools β€” fetchSourceDocument, chunkAndEmbed, upsertKnowledge β€” pass that test: each name and description maps to exactly one step, so the model never has to guess.

🧠 Quiz yourself on this lesson →

Ask the AI Tutor

Grounded in the course lessons β€” it cites its sources and says when it doesn't know.