LESSON 05 / 18·2 min readFoundation

Tools: Discovery, Schemas, Invocation, and Results

Must knowConcept lesson
01 Understand02 Recall03 Prepare

Why tools exist

Tools are model-controlled capabilities that perform queries, calculations, or actions. The client discovers tool definitions through tools/list and invokes a selected tool through tools/call.

A good tool contract

  • A specific, stable name: orders.lookup.
  • A clear description of its purpose and limitations.
  • A strict input schema with meaningful field descriptions.
  • An output schema when machine-readable results are useful.
  • Narrow permissions and predictable errors.
  • A clear separation between read and write operations.
JSON
{
  "name": "orders.lookup",
  "description": "Look up one order visible to the authenticated user",
  "inputSchema": {
    "type": "object",
    "properties": {
      "orderId": { "type": "string", "pattern": "^ORD-[0-9]+$" }
    },
    "required": ["orderId"],
    "additionalProperties": false
  }
}

Result design

Human-readable content provides the host with displayable content or a fallback. structuredContent provides predictable fields. If an output schema is declared, the server should conform to it, and the client should validate the output.

Do

  • Reuse domain services.
  • Define timeouts, pagination, and rate limits.
  • Provide confirmation flows for sensitive writes.

Do not

  • Expose a single, all-powerful run_any_sql tool.
  • Put secrets or internal credentials in tool descriptions.
  • Rely on the model prompt for authorization.
PAUSE & RECALL

Can you explain it without the notes?

Tools: Discovery, Schemas, Invocation, and Results

Use your own words. Explain an example and one limitation before checking the explanation.

Check your explanation

Why tools exist

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: Resources, Resource Templates, Prompts, and Completions

Adapted from 20_MCP_SERVER.md · “5. Tools: Discovery, Schemas, Invocation, and Results”. Examples are study fragments; framework behavior can depend on your version.