Appearance
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
- The MCP client calls
tools/callwith the tool name and input arguments - AireGlu matches the tool name to the configured exposed endpoint
- The endpoint executes with the provided input
- 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
- The MCP client calls
resources/readwith the resource URI - AireGlu matches the URI to the configured exposed endpoint
- The response is returned with the configured MIME type
Resource URIs
Each Resource requires a unique URI. Choose a descriptive scheme:
| URI Pattern | Use Case |
|---|---|
data://patient-records | Data retrieval |
file://config.json | Configuration 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
| Aspect | Tool | Resource |
|---|---|---|
| Agent action | Calls with input | Reads by URI |
| Input | Structured (JSON/XML) | None (empty payload) |
| Purpose | Perform an action | Retrieve data |
| Side effects | Expected | Not expected |
| Identified by | Name | URI |
| Schema | Auto-generated from endpoint | Not applicable |
| MIME type | N/A | Configurable (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
| Scenario | Type | Reason |
|---|---|---|
| Send an email | Tool | Requires input (recipient, subject, body) |
| Look up a patient by NHS number | Tool | Requires input (the NHS number) |
| Retrieve a list of supported regions | Resource | No input needed, returns static/semi-static data |
| Fetch today's appointment schedule | Resource | No input needed, returns current data |
| Submit a form to an external API | Tool | Requires structured input |
| Read system configuration | Resource | No 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.