Skip to main content
DigiTransact AI Learning Centre

Module 2 of 4

Tools, resources and prompts

The three capability types and when to use each.

Lesson 1

Tools

Tools are actions the model may call, with a JSON schema for arguments and a result. They can read or write, so permissions matter.

Describe the tool as a person would: what it does, when to use it, what it returns and what it will refuse.

  • Use verbs in the name: search_orders, not orders.
  • Validate every argument server side.
  • Return structured errors, not stack traces.

Check yourself. Why must a tool validate arguments the model supplied?

Lesson 2

Resources

Resources are read-only data addressed by a URI: a file, a record, a document. The client decides how to present them.

Resources suit context the user selects, while tools suit actions the model requests.

  • Resources carry data; tools carry actions.
  • Use stable URIs.
  • Keep large resources paginated.

Check yourself. When should a document be a resource rather than a tool?

Lesson 3

Prompts

Prompts are reusable templates a server offers to the user, with arguments and a rendered message. They standardise a workflow rather than an action.

They are user-invoked, which makes them safer than letting the model compose instructions from scratch.

  • Prompts are user-facing, not model-chosen.
  • Version them like code.
  • Keep them short and parameterised.

Check yourself. Who invokes a prompt in the MCP design?

Lesson 4

Schemas and errors

Arguments and results are described with JSON Schema. Clients use the schema to build the call; servers enforce it.

Errors should distinguish invalid input, missing permission and upstream failure, so the model can recover without guessing.

  • Describe required fields and formats.
  • Use errors the model can act on.
  • Never return secrets in an error.

Check yourself. What should an error tell the caller?