Skip to main content
The Court Rules API is designed to work well with AI agents. The OpenAPI spec provides everything an LLM needs to understand and call the API, and the MCP server exposes both court rules and enforcement data as native agent tools.

MCP vs REST API

If your AI tool supports the Model Context Protocol (MCP), you can connect directly to the hosted MCP server instead of using the REST API. MCP provides the same data through a standardized tool-calling interface that works natively with Claude Desktop, Cursor, and other MCP-enabled clients. See the MCP: Court Rules and MCP: Enforcement Data guides for setup instructions. The REST API approach below works with any HTTP client or agent framework.

Quick start: copy a prompt from the console

The console dashboard has ready-to-paste prompts for v0, Bolt, Replit, Lovable, Claude Code, Cursor, and Windsurf. Select your tool, copy the prompt, and paste it. The prompt includes the API endpoint, example request bodies, and instructions for building a compliance checker UI. For local tools (Claude Code, Cursor, Windsurf), your API key is included automatically.

Step 1: Download the OpenAPI spec

The spec is available as a public endpoint (no authentication required):
This returns the complete OpenAPI 3.1 specification with all endpoints, request/response schemas, and examples. The spec is auto-generated from the API’s route definitions, so it’s always up to date.

Step 2: Feed the spec to your agent

Give the OpenAPI spec to your LLM as context. Most AI agent frameworks support this natively:
  • Claude: Attach the JSON file as context or paste it into the system prompt
  • ChatGPT: Upload the file or use the Actions/Functions feature
  • LangChain / LlamaIndex: Use their OpenAPI tool loader
  • Custom agents: Parse the spec and register each endpoint as a tool

Step 3: Example agent prompt

Here’s a system prompt that turns an LLM into a court rules compliance assistant:

Agent workflow

Enforcement data in agent workflows

AI agents can monitor enforcement actions, answer regulatory questions, and trigger compliance reviews using the enforcement tools available through MCP.

Example: regulatory monitoring agent

Example agent conversation

For the full list of enforcement tools and their parameters, see the MCP: Enforcement Data guide.

Tips for agent builders

Use /rules for context

Before running a compliance check, call /rules to give your agent (and the user) full context on what rules apply. This makes the agent’s explanations more informed:

Use /check for validation

The /check endpoint is deterministic and sub-millisecond. Your agent can call it multiple times as the user iterates on their document without performance concerns:

Use /classify for PDF analysis

If the user uploads a PDF, use /classify to extract metadata and classify it before checking:
The response includes a check_request field with extracted document metadata. Before sending to /check, merge in the filing context fields that only the filer knows: is_pro_se, pmc_completed, opposing_party_pro_se, and filing_role.

Use /courts for discovery

Let the agent browse available courts and judges:

Example conversation flow

Framework-specific examples

Claude tool use

OpenAI function calling

Further reading