Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

MCP Tool Discovery, Schemas, and Errors

MCP discovery returns tool names, descriptions, and input schemas. Use those schemas to construct calls and inspect the tool result for errors.

Discover the tools available to this session

After initialization and authentication, inspect each returned tool’s name, description, and inputSchema. Follow nextCursor if returned. For a call, check both protocol errors and the tool result’s isError field.

Copy the example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {}
}

Before you begin

An authenticated MCP connection.

Key concepts

Term
Definition

Tool discovery

Retrieval of the available tool names, descriptions, and input schemas. Use the current discovered schema instead of guessing an operation name.

Tool argument

A value supplied when calling a tool. It must match that tool’s exposed input schema and refer to accessible resources.

Schema

A definition of fields, types, required values, and supported constraints. Use it to validate the shape of data; it does not establish factual correctness.

Tool result

The returned data or error from a tool operation. The agent should base its report on this result rather than assuming the call succeeded.

HTTP status

The numeric outcome returned for an HTTP request. Read the response body too; accepted work can still be running.

Discover and call an MCP tool

  1. List the tools exposed by the connected server.

  2. Choose the operation and provide fields matching its input schema.

  3. Inspect the returned content and error indicator before using its result in another step.

The client calls an available tool with valid arguments and handles its outcome.

Behavior and limitations

Transport success does not guarantee tool success. Required fields and names can differ from a similar REST endpoint. Refresh discovery after server changes. Do not invent tools from product labels or call tools absent from the authenticated catalog.

API Versions and Compatibility

Was this helpful?