Math AI LabTheoremSearch/API Docs

API Reference

TheoremSearch exposes a REST API for semantic theorem search, dependency graph exploration, and paper lookup. All endpoints are available at the base URL below.

BASE URL

https://api.theoremsearch.com
GET

Graph

GET/graph?external_id={id}

Returns the full dependency graph for a paper — all its formal statements, and the directed edges showing which statements depend on which (including cross-paper citations).

QUERY PARAMETERS

FIELDTYPEDEFAULTDESCRIPTION
external_id*stringarXiv ID or other external paper identifier, e.g. 2403.05555.

EXAMPLE

curl "https://api.theoremsearch.com/graph?external_id=2403.05555"

RESPONSE

{
  "paper": {
    "paper_id": "uuid",
    "title": "Paper Title",
    "external_id": "2403.05555",
    "source": "arXiv",
    "url": "https://arxiv.org/abs/2403.05555",
    "authors": ["Author One", "Author Two"],
    "abstract": "..."
  },
  "statements": [
    {
      "statement_id": "uuid",
      "name": "Theorem 1.1",
      "body": "Let R be a ring...",
      "note": "Informal description or null",
      "proof": "Proof text or null"
    }
  ],
  "dependencies": [
    {
      "src_statement_id": "uuid",
      "src_name": "Theorem 1.1",
      "dep_statement_id": "uuid",
      "dep_name": "Lemma 2.3",
      "dep_paper_ext_id": "2401.00001",
      "dep_paper_title": "Another Paper",
      "interpaper": true
    }
  ]
}

interpaper: true on a dependency edge means the referenced statement lives in a different paper.

MCP

TheoremSearch is available as an MCP (Model Context Protocol) server for AI agents. It exposes a single tool theorem_search with the same parameters as POST /search.

ENDPOINThttps://api.theoremsearch.com/mcp

EXAMPLE — CALL theorem_search VIA MCP

curl -X POST https://api.theoremsearch.com/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "tools/call",
    "params": {
      "name": "theorem_search",
      "arguments": {
        "query": "every projective module over a local ring is free",
        "n_results": 5
      }
    }
  }'

RESPONSE

{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
    "content": [{ "type": "text", "text": "{...serialized SearchResponse...}" }],
    "structuredContent": { "theorems": [...] }
  }
}

SUPPORTED METHODS

FIELDTYPEDEFAULTDESCRIPTION
initializeHandshake. Returns protocol version and server capabilities.
tools/listReturns the theorem_search tool schema.
tools/callInvokes theorem_search with the given arguments.