> ## Documentation Index
> Fetch the complete documentation index at: https://docs.madra.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Tool Schemas

> The shape of MCP tool listings in the Bazaar and how they are published and consumed.

MCP tools are cataloged by the Bazaar with a schema that mirrors the Model Context Protocol tool definition, plus the payment terms that make them x402-payable.

## Listing schema

```json theme={null}
{
  "type": "mcp",
  "id": "lst_01H...",
  "resource": "mcp://tools.example.com/summarize",
  "name": "summarize",
  "description": "Summarize an input document into 3 bullet points",
  "inputSchema": {
    "type": "object",
    "properties": {
      "text": { "type": "string", "description": "Text to summarize" }
    },
    "required": ["text"]
  },
  "outputSchema": {
    "type": "object",
    "properties": {
      "bullets": { "type": "array", "items": { "type": "string" } }
    }
  },
  "payment": {
    "scheme": "upto",
    "network": "stellar:pubnet",
    "asset": "USDC",
    "amount": "50000",
    "pricing": { "unit": "1k_tokens", "pricePerUnit": "5000" }
  }
}
```

## Publishing (seller side)

MCP servers built with `@stellarx402/mcp` publish automatically on startup. Manual publish:

```http theme={null}
POST /discovery/publish HTTP/1.1
Content-Type: application/json
Authorization: Bearer <seller-token>

{
  "type": "mcp",
  "resource": "mcp://tools.example.com/summarize",
  "name": "summarize",
  "description": "...",
  "inputSchema": { ... },
  "payment": { ... }
}
```

## Consumption (buyer side)

```bash theme={null}
curl "$FAC/mcp/tools?q=summarize"
```

Returns the same listings you would get from `/discovery/search?type=mcp` — this endpoint is a convenience that pre-filters by type.

## Invocation

An agent invokes an MCP tool through its MCP client (transport-agnostic), attaching an `X-Payment` header shaped identically to the HTTP case. See [MCP Integration for Agents](/guides/buyers/mcp-integration).
