Skip to main content
Grounding an AI agent in authoritative legal text is one of the most common uses of this API. There are two ways to do it: connect an MCP-compatible client to the hosted Vaquill MCP server, or wrap the REST API as a tool your own agent can call. Both return citations and source links, so answers stay grounded in official government text. Endpoints used: POST /statutes/search for the custom-tool path. The hosted server path needs no direct REST calls from you.

Path A: Hosted Vaquill MCP server

The fastest route is the hosted Vaquill MCP server. Any MCP-compatible client can connect to it and query US statutes and regulations directly, without you writing glue code. The server exposes statute search and retrieval as tools the agent can call, and every result comes back with a citation and a link to the official source.

Vaquill MCP server

Connection details, available tools, and setup steps for the hosted MCP server.
Use this path when your agent runs inside an MCP-compatible client and you want statute access with the least integration work.

Path B: Wrap the REST API as your own tool

When you are building your own tool-calling agent, define a search_statutes function backed by POST /statutes/search and register it as a tool. The agent decides when to call it, and you return cited results the model can quote.
1

Implement the tool function

The function takes a query and optional scoping, calls search, and returns a compact, citation-first list. Trimming the payload to the fields the model needs keeps token use low.
Python
2

Declare the tool schema

Tool-calling agents need a schema so the model knows when and how to call your function. This shape (a name, a description, and a JSON Schema for parameters) is the common convention across tool-calling frameworks.
Python
3

Run the tool-call loop

When the model asks to call search_statutes, run the function with its arguments and hand the cited results back. The exact plumbing depends on your framework, but the flow is always the same: read the tool call, dispatch to the function, return the result, let the model compose a grounded answer.
Python
4

Keep answers grounded

Instruct the model to cite the citation field and link the sourceUrl for every legal claim, and to say when the corpus returns no match rather than guessing. This keeps the agent honest and traceable back to official text.
For heavy agent traffic, cache the /statutes/coverage response and reuse it to steer corpusType and state on tool calls. That narrows searches and avoids searching jurisdictions with no data.

Vaquill MCP server

Connect an MCP-compatible client to the hosted server.

Enrich a citation database

Batch-resolve topics into cited, sourced records.

Compare a rule across states

Run one query across several states.

Best practices

Scope queries, cache coverage, and handle errors well.