Skip to main content
Glama

legal-contract-mcp

CI

An MCP (Model Context Protocol) server that gives an LLM client (Claude, Claude Code, Claude Desktop, etc.) tools to do a first-pass review of contracts: load a .txt/.docx/.pdf, detect standard clause types, flag heuristic risk issues, generate a summary, and diff two contracts against each other.

This is not legal advice — it's a rules-based first pass meant to speed up human review, built to demonstrate a real, non-trivial MCP server (as opposed to a toy "add two numbers" example).

Why this exists

Most MCP server examples are thin wrappers around an API call. This one does actual work locally:

  • Parses real document formats (txt/docx/pdf)

  • Detects 12 standard clause types via a maintained pattern library, not a single regex

  • Runs 8 explainable risk heuristics (e.g. indemnification without a liability cap, auto-renewal without a clear notice period, non-competes with no defined scope) — every flag cites the exact clause text it's based on

  • Falls back gracefully to an extractive summary if no OPENAI_API_KEY is set, and upgrades to an LLM-generated summary if one is

Related MCP server: Contract Review AI MCP

Tools exposed

Tool

Description

load_contract(path)

Load a .txt/.docx/.pdf file, returns a doc_id

list_documents()

List contracts loaded in this session

extract_clauses(doc_id)

Detected clause types with snippets

missing_clauses(doc_id)

Standard clause types NOT found — gap check

flag_risks(doc_id)

Heuristic risk flags with severity + evidence

summarize_contract(doc_id)

Plain-English summary (LLM or extractive fallback)

compare_contracts(doc_id_a, doc_id_b)

Diff clause types and risk flags between two contracts

search_clause_library(query)

Look up a clause type's definition by keyword

Setup

python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -e ".[dev]"

Optional — enable LLM-powered summaries:

export OPENAI_API_KEY=sk-ant-...

Run it

Inspector (interactive dev UI):

mcp dev src/legal_contract_mcp/server.py

As a stdio server (for Claude Desktop / Claude Code config):

{
  "mcpServers": {
    "legal-contract-mcp": {
      "command": "python",
      "args": ["-m", "legal_contract_mcp.server"],
      "cwd": "/absolute/path/to/legal-contract-mcp",
      "env": { "OPENAI_API_KEY": "sk-ant-..." }
    }
  }
}

Then in a chat with the connected client:

Load the contract at tests/sample_contracts/weak_nda.txt and flag its risks.

Test

pytest                    # unit tests for clause detection + risk rules
python scripts/smoke_test.py   # spins up the real MCP server over stdio and calls every tool

Includes two sample contracts (tests/sample_contracts/weak_nda.txt and solid_msa.txt) chosen so the risk engine's output differs meaningfully between a weak and a well-drafted agreement — tests assert on that difference, not just "does it run."

Project structure

src/legal_contract_mcp/
  parsing.py         # txt/docx/pdf -> plain text, in-memory doc store
  clause_library.py  # 12 clause types: definitions + detection patterns
  clauses.py         # runs the library against a document
  risk_rules.py       # 8 heuristic risk rules, each with cited evidence
  llm.py              # optional Claude-powered summary, extractive fallback
  server.py           # FastMCP tool definitions
tests/
  sample_contracts/   # weak NDA vs. solid MSA fixtures
  test_clauses_and_risks.py

Extending it

  • Add a clause type: add an entry to CLAUSE_LIBRARY in clause_library.py with a definition and one or more regex patterns.

  • Add a risk rule: add a function block to evaluate_risks() in risk_rules.py — return a RiskFlag with rule, severity, message, and evidence.

  • Swap the in-memory store in parsing.py for a database if you want documents to persist across server restarts.

Disclaimer

This tool provides automated, heuristic pattern-matching only. It is not a substitute for review by a licensed attorney and should not be relied on as legal advice.

Available Tools

8 tools
compare_contractsA

Compare two loaded contracts: which clause types each one has that the other lacks, and how their risk flags differ.

Args: doc_id_a: doc_id of the first contract. doc_id_b: doc_id of the second contract.

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_id_aYes
doc_id_bYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full behavioral burden. It transparently describes what the operation reports—clause-type gaps in both directions and risk flag differences—and 'compare' implies a non-mutating read. But it does not explicitly state that documents are unchanged, whether prior flag_risks processing is required, or how errors are surfaced.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: the first sentence captures the complete purpose and output, followed by a short parameter list. There is no filler, and the structure makes the key behavioral details immediately visible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is moderately simple and has no output schema or annotations, so the description must explain both output and preconditions. It clearly explains what the comparison returns and implies the docs must already be loaded, but it does not describe the return format, how risk flags are expected to be present, or what happens when a document is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the Args block provides the necessary compensation by identifying doc_id_a and doc_id_b as the identifiers of the first and second contract being compared. This adds ordering semantics, but it omits details like how to obtain valid doc_ids, which would be useful since no parameter descriptions exist in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear verb and resource: comparing two loaded contracts. It also specifies the exact comparison dimensions—which clause types each contract lacks relative to the other, and how risk flags differ—making it clearly distinguishable from siblings like summarize_contract or missing_clauses.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'loaded contracts' implies the important precondition that documents must already be loaded, so an agent can infer this pairs with load_contract. However, it does not explicitly say when to prefer this tool over closely related siblings like missing_clauses, nor does it state exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

extract_clausesA

Detect standard clause types (indemnification, termination, IP, etc.) present in a loaded contract, with a text snippet for each.

Args: doc_id: doc_id returned by load_contract.

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYes

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral disclosure burden. It discloses the prerequisite ('doc_id returned by load_contract') and the general output form, but does not describe return structure, error behavior, or the full set of clause types detected. 'Detect' implies read-only behavior, but this is not stated explicitly.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two focused sentences plus a terse Args entry. It front-loads purposehare, lists representative clause types, and includes only the necessary parameter guidance. No filler or redundant restatement.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter, read-oriented tool with no output schema, the description provides sufficient invocation guidance: purpose, required input provenance, and a basic indication of output. It could be more complete with explicit return-format or error-handling notes, but these are not critical for basic use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. The Args section does this well: 'doc_id: doc_id returned by load_contract' adds essential meaning beyond the schema's generic 'Doc Id' title and tells the agent exactly where to obtain the value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific action ('Detect standard clause types') and a specific resource ('a loaded contract'), and specifies the output ('a text snippet for each'). This clearly distinguishes it from siblings like missing_clauses and search_clause_library, which address different use cases.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear usage context by stating the tool operates on a loaded contract and that doc_id must come from load_contract. It does not explicitly compare against alternatives or state when not to use it, but the prerequisite and context are unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

flag_risksA

Run heuristic risk rules against a loaded contract (e.g. uncapped liability, auto-renewal without notice, one-sided termination) and return the flags with severity and supporting evidence.

Args: doc_id: doc_id returned by load_contract.

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYes

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden and does reasonably well: it discloses that this runs heuristic rules, names representative rule categories, and states that it returns flags with severity and evidence. It does not mention side effects, but the operation is clearly a read-style analysis and no destructive behavior is implied.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Every part earns its place: a one-sentence functional summary with illustrative examples, followed by a single argument description. The information is front-loaded and free of filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (one required parameter) and the description covers the input source, the operation, and the return content. Since there is no output schema, the description's mention of flags with severity and supporting evidence is adequate; details of the exact response format are not critical for invoking the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must document the parameter, and it does: 'doc_id: doc_id returned by load_contract.' This adds provenance semantics beyond the schema's bare string type, telling the agent the ID must come from a prior load_contract call.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource: 'Run heuristic risk rules against a loaded contract' and names concrete example rules, so an agent can distinguish risk flagging from sibling tools like extract_clauses or summarize_contract. It also states what is returned (flags with severity and supporting evidence), making the tool's purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context: the tool acts on a loaded contract and takes the doc_id returned by load_contract, so invocation sequencing is obvious. It does not explicitly list when-not-to-use or compare with sibling tools, but the prerequisite is stated clearly enough for correct selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_documentsA

List all contracts currently loaded into this server's session.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry the burden. 'List' implies a read-only operation, and 'currently loaded' discloses state dependency, but it does not explicitly state that no modifications occur, what the return format is, or behavior with an empty session.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no wasted words. Every part of the sentence adds meaningful information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple zero-parameter list tool, the description is mostly complete: it states the operation and scope. However, without an output schema, it could have briefly mentioned the return shape, though 'List all contracts' strongly implies the returned list.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the baseline is 4. The description adds no parameter details, but none are needed; the schema already confirms an empty parameter set.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('List') and a clear resource ('all contracts currently loaded into this server's session'). It distinguishes itself from siblings like load_contract and extract_clauses by focusing on listing already-loaded session documents.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'currently loaded into this server's session' phrase implies this is the tool to call after contracts have been loaded and before other operations. However, it does not explicitly state when to use it versus alternatives or mention any exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

load_contractB

Load a contract file (.txt, .docx, or .pdf) from disk and return its doc_id.

Args: path: Absolute or relative path to the contract file.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the accepted file formats and return value, but doesn't mention error behavior for missing files, invalid formats, or file size limits. It also doesn't state whether the file is parsed or just stored.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded with the core purpose. The Args section is minimal but sufficient for a single-parameter tool. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple loader with one parameter and no output schema, the description covers the essential purpose and parameter. However, it lacks error-handling details and doesn't explain what doc_id is or how it relates to other tools, which could leave an agent uncertain about downstream usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains the 'path' parameter as an absolute or relative path to the contract file, which adds meaning beyond the schema's bare type definition. However, it doesn't clarify path format nuances or whether the file must exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool loads a contract file from disk and returns a doc_id, with a specific verb and resource. It distinguishes itself from siblings like list_documents and extract_clauses, though it doesn't explicitly name them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage: it is the entry point for loading a contract file before other operations like extract_clauses or summarize_contract. However, it doesn't explicitly state when to use it versus alternatives or mention prerequisites like file existence or format support.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

missing_clausesA

List standard clause types from the reference library that were NOT found in a loaded contract — useful for spotting gaps.

Args: doc_id: doc_id returned by load_contract.

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYes

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry the behavioral burden. It implies a read-only list operation, and the parameter explanation indicates a prerequisite (loaded contract). However, it does not explicitly state the operation is non-mutating or disclose any potential side effects or error behavior. It provides some context but not comprehensive transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: it states the core purpose in the first sentence and the argument explanation in the second. Every sentence earns its place with no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and no output schema, the description provides the essential information: purpose and parameter meaning. It does not detail the output format (beyond implying a list) or error scenarios, but these are minor gaps for such a straightforward operation. Overall, it is complete enough for an agent to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. It fully explains the sole parameter doc_id as 'doc_id returned by load_contract,' adding provenance and usage context beyond the schema's type-only definition. This is exactly what the dimension expects.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb ('List') and resource ('standard clause types from the reference library that were NOT found in a loaded contract'). It distinguishes from siblings like extract_clauses by focusing on what's missing rather than what's present. The purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage after loading a contract ('doc_id returned by load_contract') and notes it's 'useful for spotting gaps,' but it does not explicitly state when to use this tool versus alternatives, nor does it mention exclusions. Guidance is present but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_clause_libraryA

Search the reference library of standard clause types by keyword, e.g. 'liability' or 'renewal', and get plain-English definitions.

Args: query: Free-text search term.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the read-only nature via 'Search' and the result type ('plain-English definitions'), but does not mention matching behavior, return structure, or any limitations. For a simple search tool this is adequate but thin.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short, front-loaded with the core function, and includes a compact Args block. No redundant phrases; every sentence adds information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given one required string parameter and no output schema, the description covers the tool's purpose, input, and output type at a high level. It is missing details about whether results are ranked, how many definitions return, or how to handle no results, but these are not critical for a simple library search. The sibling set is distinct enough that an agent can select it without confusion.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides only the parameter name and type (query: string) with 0% description coverage. The description compensates by defining query as 'Free-text search term' and giving concrete examples ('liability' or 'renewal'). This makes the expected input clear, though it does not specify constraints like max length or allowed phrasing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Search') and resource ('reference library of standard clause types'), and describes the outcome ('get plain-English definitions'). The examples 'liability' or 'renewal' clarify the resource type. This distinguishes it from sibling tools that operate on contract documents, so the agent can identify it as a knowledge-base lookup.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies a use case (looking up definitions of clause types) but does not explicitly say when to prefer this over extract_clauses, missing_clauses, or other siblings. There are no 'when not to use' or alternative routing instructions. The context is enough for a human, but the agent gets no explicit decision rule.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

summarize_contractA

Summarize a loaded contract in plain English and list the top things a reviewer should double check. Uses Claude if ANTHROPIC_API_KEY is set in the server environment, otherwise falls back to an extractive summary built from detected clauses and risk flags.

Args: doc_id: doc_id returned by load_contract.

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses an important behavioral trait: the tool switches between Claude-based generation and an extractive fallback depending on ANTHROPIC_API_KEY. However, it does not mention whether the operation is read-only, what happens with an invalid doc_id, or latency/cost implications.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded: the first sentence states purpose, the second exposes fallback behavior, and the Args section cleanly documents the parameter. Every sentence adds value, though the fallback details could be slightly tightened.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a single parameter, an output schema, and no annotations, the description is mostly complete. It covers purpose, behavior, parameter semantics, and the prerequisite relationship to load_contract. It leaves out explicit error handling and output structure, but the output schema covers the latter.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides only 'Doc Id' with no description (0% coverage). The description compensates fully by explaining that doc_id is the value 'returned by load_contract', giving the agent critical provenance and prerequisite information beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Summarize'), a resource ('a loaded contract'), and a concrete output ('plain English' summary plus 'top things a reviewer should double check'). This clearly distinguishes it from siblings like load_contract, extract_clauses, and flag_risks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description establishes a clear prerequisite: the contract must already be loaded, and doc_id must be the one returned by load_contract. This gives an agent a clear when-to-use context, though it does not explicitly name alternatives or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 8 tool updatesv0.1.0
    • First observedcompare_contracts
    • First observedextract_clauses
    • First observedflag_risks
    • First observedlist_documents
    • First observedload_contract
    • First observedmissing_clauses
    • First observedsearch_clause_library
    • First observedsummarize_contract

TDQS

A3.9/5.0

Scored across 8 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: loading, listing, extracting clauses, flagging risks, summarizing, comparing, gap analysis, and library search. There is no meaningful overlap between tool responsibilities.

Naming Consistency4/5

Most tools follow a consistent snake_case verb_noun pattern like load_contract, extract_clauses, and compare_contracts. The one minor deviation is missing_clauses, which is not in an imperative verb form.

Tool Count5/5

With 8 tools, the server is well-scoped for contract analysis. Each tool covers a distinct part of the workflow without redundancy or bloat.

Completeness4/5

The core analysis workflow is well covered: load, extract, flag, summarize, compare, and check missing clauses. Minor gaps exist such as no tool for unloading documents or retrieving raw full contract text, but agents can work around these.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers