---
title: "Call MCP tools/list or tools/call via JSON-RPC."
method: POST
path: "/mcp"
---

# Call MCP tools/list or tools/call via JSON-RPC.

`POST /mcp`

## Request

- Base URL: `https://git.top`
- URL: `https://git.top/mcp`
- Auth: none declared

## Request body

- McpJsonRpcRequest: JSON-RPC 2.0 request accepted by POST /mcp.
  - `jsonrpc` '2.0', required
  - `id` union: Client-chosen request id returned unchanged in success or error responses. Omit for JSON-RPC notifications.
    - string
    - number
  - `method` 'initialize' | 'notifications/initialized' | 'tools/list' | 'tools/call', required: Supported JSON-RPC method.
  - `params` object
    - `name` string: Tool name for tools/call.
    - `arguments` object: Tool arguments. Pass require_d1=true for high-confidence D1-backed reads.

## Response `200`

JSON-RPC success result. For tools/call, parse result.content[0].text as JSON before reading metadata or result fields; git_top_grp_query defaults to profile=compact and accepts profile=full for the complete graph.

- McpJsonRpcSuccessResponse: JSON-RPC 2.0 success response. initialize returns server capabilities, tools/list returns tool metadata, and tools/call returns MCP content blocks; Git.Top serializes structured tool payloads as JSON text in result.content[0].text.
  - `jsonrpc` '2.0', required
  - `id` union, required
    - string
    - number
  - `result` union, required
    - object: initialize result.
      - `protocolVersion` string
      - `capabilities` object
      - `serverInfo` object
    - object: tools/list result.
      - `tools` object[]
    - object: tools/call result. Parse text content as JSON.
      - `content` object[], required
        - `type` 'text', required
        - `text` string, required: JSON string containing the structured tool result, usually with metadata.source and metadata.reason. git_top_grp_query includes profile and defaults to a bounded compact graph response; use profile=full for the complete graph.

## Other responses

- `202`: Accepted JSON-RPC notification with no response body, used for notifications/initialized.
- `400`: JSON-RPC error result for invalid JSON, unsupported methods, unknown tools, invalid arguments, strict D1 failures (-32003), stale cursors (-32004), or unresolved singular projects (-32005).

---

[API](https://skmtc.dev/git/apis/git-top-agent-api.md) · [All operations](https://skmtc.dev/git/apis/git-top-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/git/apis/git-top-agent-api/revisions/c9ebf661ef6d?raw)
