{
  "$schema": "https://modelcontextprotocol.io/schema/2025-06/tools.json",
  "server": {
    "name": "crabcc",
    "version": "0.4.0",
    "protocol": "jsonrpc-2.0",
    "transport": "stdio",
    "description": "Symbol index for AI coding agents. Four read-only primitives over a local SQLite symbol store."
  },
  "capabilities": {
    "tools": { "listChanged": false },
    "stateless": true,
    "readOnly": true
  },
  "tools": [
    {
      "name": "sym",
      "description": "Look up a symbol by name. Returns its kind (class/fn/method), file and line — the definition, not every text match.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "description": "Symbol name to resolve" },
          "limit": { "type": "integer", "minimum": 1, "description": "Cap the number of results" }
        },
        "required": ["name"]
      }
    },
    {
      "name": "refs",
      "description": "Every place a symbol is referenced, deduped by file. Use files_only to collapse to a path list.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "description": "Symbol to find references to" },
          "files_only": { "type": "boolean", "default": false },
          "count": { "type": "boolean", "default": false, "description": "Return only the integer count" }
        },
        "required": ["name"]
      }
    },
    {
      "name": "callers",
      "description": "Who calls this function. Walks the call graph upward without loading source into the model.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "description": "Function name" },
          "count": { "type": "boolean", "default": false },
          "depth": { "type": "integer", "minimum": 1, "default": 1 }
        },
        "required": ["name"]
      }
    },
    {
      "name": "outline",
      "description": "The shape of a file — its symbols in order, nested. The cheapest way to orient before reading.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "path": { "type": "string", "description": "File path relative to repo root" }
        },
        "required": ["path"]
      }
    }
  ]
}
