# MCP

    endpoint:  https://gw.mizint.com/mcp
    transport: streamable HTTP (POST JSON-RPC; no server-initiated stream)
    auth:      Authorization: Bearer <gateway key>   (x-api-key also accepted)

Methods: `initialize`, `ping`, `tools/list`, `tools/call`. Notifications
are acknowledged with 202. A `Mcp-Session-Id` is issued on `initialize`
for clients that expect one; the server is stateless and never requires
it.

## Tools

`tools/list` is filtered by your key's policy, exactly like `/v1/models`:

| Tool | What it does |
|---|---|
| `list_models` | The same document as `GET /v1/models` |
| `poll_job` | `{job_id}` → the job's status and output |
| `<alias>` (text) | `{prompt, system?, max_tokens?}` → the assistant's text; the full completion is `structuredContent` |
| `<alias>` (image) | the alias's `input_schema` → `{data:[{url, file_id, mime_type}]}` |
| `<alias>` (video, audio, task) | the alias's `input_schema` → a job: `{job_id, status}`; poll with `poll_job` |
| `<route>` | a third-party route published as a tool: its declared `input_schema` → the upstream's response |
| `<server>__<tool>` | a tool of an upstream MCP server aggregated behind this one |

A tool call runs through the gateway exactly as the equivalent REST call
would — same policy, budget, clamp, fallback and spend log. A policy or
budget refusal comes back as a result with `isError: true` carrying the
error document; only a malformed request is a JSON-RPC error.

Every gateway-native tool's `inputSchema` is the one schema the alias or
route declares — there is no second copy to drift.
