MCP: Model Context ProtocolBeginnerModule 05 — Understanding MCP tools

How does MCP tools/list advertise tool metadata and discovery results?

Question 38 of 43 · Updated

On this page

Direct answer#

The MCP tools/list method lets a client discover which tools a server currently exposes and how to use them. The server returns tool descriptors, including each tool's name and inputSchema, with optional descriptions and other metadata. A large catalog can be returned in pages.

Think of it as a menu of callable operations: the menu describes what you can order, but reading it does not place an order.

This lesson uses the historical MCP 2025-06-18 specification as its reference baseline.

1. Discover tools before calling them#

Imagine a shipping assistant connected to a server that offers shipping_quote and track_shipment.

The server advertises the tools capability during initialization. That tells the client that the tools feature is supported, but does not tell it the names of the available tools. After the applicable initialization completes, the client can send:

JSON
{ "jsonrpc": "2.0", "id": 1, "method": "tools/list" }

The request needs no tool name. It asks for the available catalog, not for execution of a particular operation.

Example response:

JSON
{ "jsonrpc": "2.0", "id": 1, "result": { "tools": [ { "name": "shipping_quote", "description": "Estimate shipping charges without booking a shipment.", "inputSchema": { "type": "object", "properties": { "zone": {"type": "string", "enum": ["local", "regional"]}, "weight_grams": {"type": "integer", "minimum": 1} }, "required": ["zone", "weight_grams"] } } ], "nextCursor": "opaque-page-2" } }

This is a fictional server and a valid illustrative historical message shape. It describes the shipping_quote operation; no quote has been calculated.

2. What information does the descriptor provide?#

FieldPurpose
nameRequired operation identifier on the server
inputSchemaRequired JSON Schema object describing expected arguments
descriptionOptional explanation of what the tool does and when to use it
titleOptional human-readable display name in this revision
outputSchemaOptional schema describing structured results
annotationsOptional hints about behavior, such as read-only or destructive operations

The server provides the descriptor; the host can use it to construct a model-facing tool definition, a form or a deterministic workflow.

For the shipping example, the input schema tells the application that it must supply a zone and a positive integer weight in grams. The description tells it that the operation estimates a price rather than booking a shipment.

A model-facing representation may differ from the original MCP descriptor because a model provider has its own tool schema format. Preserve the original contract and validate any conversion. A description or annotation is not proof of safety or permission.

3. How pagination works#

The first response contains nextCursor, indicating that further discovery results are available. The client passes that opaque value back as params.cursor in a new request:

JSON
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {"cursor": "opaque-page-2"} }

The server might respond:

JSON
{ "jsonrpc": "2.0", "id": 2, "result": { "tools": [ { "name": "track_shipment", "description": "Retrieve the current status of an authorized shipment.", "inputSchema": { "type": "object", "properties": {"tracking_id": {"type": "string"}}, "required": ["tracking_id"] } } ] } }

There is no nextCursor in this response, so the listing is complete. Each request has its own JSON-RPC ID. The cursor is supplied by the server, not calculated from the request ID or interpreted as a page number.

An empty tools array is valid. In particular, a host's local filtering may leave a page with no permitted entries even though a continuation cursor exists. Continue according to the cursor rather than the number of visible tools.

Do not assume that a changing catalog is an immutable snapshot across pages. Bound discovery time and page count; handle stale cursors and duplicate names according to the actual implementation. The dedicated pagination lesson Q111 covers robust iteration and failure handling.

Loading diagram…

4. Practical example: filter a page without losing its cursor#

A host may allow a customer assistant to estimate shipping but prohibit it from booking shipments. The following small Python function demonstrates a local catalog projection after the response has already been validated:

PYTHON
def catalog_page(result, approved_names): """Project an already decoded, validated tools/list result.""" visible = [tool for tool in result['tools'] if tool['name'] in approved_names] return visible, result.get('nextCursor')

For example:

PYTHON
page = { "tools": [{"name": "book_shipment"}], "nextCursor": "opaque-2" } print(catalog_page(page, {"shipping_quote"}))

Output:

([], 'opaque-2')

The descriptor in this tiny fixture is intentionally abbreviated. The host filters out book_shipment but retains the cursor to continue discovering other tools.

Four local unit tests passed on Python 3.13.5, including preservation of an approved descriptor, an empty final page, a filtered page with a cursor and an opaque cursor that looks numeric. The function assumes previously validated descriptors and an approved server-specific allowlist. It does not perform discovery over a network, copy nested metadata, authenticate the user or authorize execution. Real clients should use a compatible SDK and retain the trusted originating route.

5. What if the tool catalog changes?#

In the historical revision, a server advertising the optional tools.listChanged capability can send a notification:

JSON
{ "jsonrpc": "2.0", "method": "notifications/tools/list_changed" }

This indicates that the catalog has changed; it is not a replacement tools array. The host can invalidate the affected catalog and rediscover it with tools/list. If listChanged is not advertised, do not rely on these notifications; refresh according to an appropriate local policy.

Before executing a tool, verify that the selected descriptor still belongs to the current approved server relationship. Two servers can advertise tools with the same name. Discovery does not authorize invocation, and the server must independently enforce permission and validate arguments when a tool is called.

Interview-ready answer#

tools/list is MCP's tool-discovery method. It returns a tools array of descriptors, including tool names, input schemas and optional metadata. The client follows nextCursor through additional requests when present, validates the descriptors and exposes an approved subset. Catalog-change notifications can trigger rediscovery where supported. Listing is separate from tools/call: it describes operations without executing them or granting permission.

Next: Q48 explains how tools/call invokes a discovered operation and returns its outcome.

References and verification#

Historical 2025-06-18 baseline; authorized offline research and changelog exceptions applied. Official references were not retrieved live. The local Python projection was syntax-compiled and tested with warnings treated as errors (4/4 tests passed); no MCP SDK, real transport or live server was exercised. Mermaid rendering was not verified locally.

References

  1. 1.
    MCP toolsmodelcontextprotocol.io
  2. 2.
    MCP paginationmodelcontextprotocol.io
  3. 3.
    MCP lifecyclemodelcontextprotocol.io
  4. 4.
  5. 5.

Related questions

Explore other topics:Forward Deployed EngineeringAI AgentsLarge Language ModelsRetrieval-Augmented Generation