Skip to content

Tools and Resources

MCP defines two ways to expose functionality to MCP clients: Tools and Resources. Understanding the difference is essential for designing an effective MCP server.

Tools

A Tool is an action that an MCP Client can invoke. When an agent calls a tool, AireGlu executes the mapped endpoint with the agent's input and returns the result.

Characteristics

  • Invocable - The client actively calls the tool with parameters
  • Input-driven - The client provides structured input (JSON or XML) matching the endpoint's schema
  • Side effects expected - Tools typically perform operations: sending emails, submitting data, triggering workflows
  • Schema-aware - AireGlu automatically generates a JSON Schema from the target endpoint's configuration, which the client uses to construct valid input

When to Use Tools

Use a Tool when the endpoint:

  • Performs an action (send, create, update, delete, trigger)
  • Requires input from the agent
  • Produces a result based on that input
  • Has side effects (writes data, sends messages, starts processes)

How Tools Work at Runtime

  1. The MCP client calls tools/call with the tool name and input arguments
  2. AireGlu matches the tool name to the configured exposed endpoint
  3. The endpoint executes with the provided input
  4. The endpoint response is returned to the agent as the tool result

Input Schema Generation

AireGlu generates the tool's input schema automatically from the target endpoint:

  • JSON endpoints - The endpoint's configured JSON schema is used directly. If no schema is defined, an empty object schema is provided.
  • XML endpoints - An enhanced schema is generated from the endpoint's XSD, including documentation elements from the XSD as descriptions.
  • Other formats (HL7, plain text) - A string content schema is generated with instruction text describing the expected format.

Resources

A Resource is data that an MCP client can read. When an agent reads a resource, AireGlu executes the mapped endpoint with no input and returns the response.

Characteristics

  • Readable - The agent reads the resource to retrieve data
  • No input - Resources are invoked with an empty payload ({})
  • Identified by URI - Each resource has a unique URI (e.g. data://patient-list)
  • Content-typed - Each resource declares its MIME type (e.g. application/json)

When to Use Resources

Use a Resource when the endpoint:

  • Returns data without requiring input
  • Provides context or reference information
  • Acts as a data source for the agent's reasoning
  • Does not have meaningful side effects

How Resources Work at Runtime

  1. The MCP client calls resources/read with the resource URI
  2. AireGlu matches the URI to the configured exposed endpoint
  3. The response is returned with the configured MIME type

Resource URIs

Each Resource requires a unique URI. Choose a descriptive scheme:

URI PatternUse Case
data://patient-recordsData retrieval
file://config.jsonConfiguration data
aireglu://<server>/<name>Generic AireGlu resource

If no URI is specified, AireGlu auto-generates one in the format aireglu://<server-name>/<endpoint-name>.

URIs must be unique within a version (case-insensitive).

Comparison

AspectToolResource
Agent actionCalls with inputReads by URI
InputStructured (JSON/XML)None (empty payload)
PurposePerform an actionRetrieve data
Side effectsExpectedNot expected
Identified byNameURI
SchemaAuto-generated from endpointNot applicable
MIME typeN/AConfigurable (default: application/json)

Choosing Between Tool and Resource

Ask yourself: Does the MCP client need to send data to get a result?

  • Yes → Use a Tool. The agent provides input, and the endpoint processes it.
  • No → Use a Resource. The agent just needs to read the output.

Examples

ScenarioTypeReason
Send an emailToolRequires input (recipient, subject, body)
Look up a patient by NHS numberToolRequires input (the NHS number)
Retrieve a list of supported regionsResourceNo input needed, returns static/semi-static data
Fetch today's appointment scheduleResourceNo input needed, returns current data
Submit a form to an external APIToolRequires structured input
Read system configurationResourceNo input needed

Restrictions

The following endpoint types cannot be exposed via MCP:

  • Endpoints with Callback input mode
  • Endpoints with AdapterCallback input mode

These modes require interactive or asynchronous input mechanisms that are incompatible with the MCP request-response model.