Skip to main content
Glama

Search contract documents

clm_search_contract_documents
Read-onlyIdempotent

Find cited passages across accessible documents by exact wording, meaning or both. Returns matches and any continuation cursor. Use clm_read_contract_document to read a known document sequentially. Semantic/hybrid queries reach an external embedding provider.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "clm_search_contract_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoExact wording, meaning, or bothhybrid
limitNoPassage limit
queryYesClause text or question
cursorNoPrior exact-search cursor
contractIdNoContract ID
documentIdNoDocument ID; requires contractId
includeRelatedNoInclude effective related documents

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • changedInput schema / properties / contractId / description
      Previous value: -"Optional contract identifier"New value: +"Contract ID"
    • removedInput schema / properties / contractId / pattern
      Removed value: -"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    • changedInput schema / properties / cursor / description
      Previous value: -"Continuation cursor from a prior exact search"New value: +"Prior exact-search cursor"
    • changedInput schema / properties / documentId / description
      Previous value: -"Optional document identifier. Requires contractId."New value: +"Document ID; requires contractId"
    • removedInput schema / properties / documentId / pattern
      Removed value: -"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum passages"New value: +"Passage limit"
    • changedInput schema / properties / mode / description
      Previous value: -"Exact wording, matching meaning, or both"New value: +"Exact wording, meaning, or both"
    • changedInput schema / properties / query / description
      Previous value: -"Clause text or a natural-language question"New value: +"Clause text or question"
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": false,
      -  "properties": {
      -    "completeness": {
      -      "enum": [
      -        "complete",
      -        "partial"
      -      ],
      -      "type": "string"
      -    },
      -    "items": {
      -      "description": "Document text with citations",
      -      "items": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "citation": {
      -            "additionalProperties": false,
      -            "description": "Source citation for this text",
      -            "properties": {
      -              "chunkId": {
      -                "anyOf": [
      -                  {
      -                    "allOf": [
      -                      {
      -                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -                        "type": "string"
      -                      },
      -                      {
      -                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -                        "type": "string"
      -                      }
      -                    ],
      -                    "type": "string"
      -                  },
      -                  {
      -                    "type": "null"
      -                  }
      -                ]
      -              },
      -              "citationId": {
      -                "description": "Stable evidence citation identifier",
      -                "minLength": 1,
      -                "type": "string"
      -              },
      -              "contractId": {
      -                "allOf": [
      -                  {
      -                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -                    "type": "string"
      -                  },
      -                  {
      -                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -                    "type": "string"
      -                  }
      -                ],
      -                "description": "Contract UUID containing the cited passage",
      -                "type": "string"
      -              },
      -              "contractTitle": {
      -                "description": "Contract title at the cited passage",
      -                "minLength": 1,
      -                "type": "string"
      -              },
      -              "endOffset": {
      -                "anyOf": [
      -                  {
      -                    "maximum": 9007199254740991,
      -                    "minimum": 0,
      -                    "type": "integer"
      -                  },
      -                  {
      -                    "type": "null"
      -                  }
      -                ]
      -              },
      -              "fileId": {
      -                "allOf": [
      -                  {
      -                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -                    "type": "string"
      -                  },
      -                  {
      -                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -                    "type": "string"
      -                  }
      -                ],
      -                "description": "Effective document version UUID containing the passage",
      -                "type": "string"
      -              },
      -              "fileName": {
      -                "description": "Document file name",
      -                "minLength": 1,
      -                "type": "string"
      -              },
      -              "fileRole": {
      -                "enum": [
      -                  "primary",
      -                  "related"
      -                ],
      -                "type": "string"
      -              },
      -              "fileStatus": {
      -                "const": "effective",
      -                "type": "string"
      -              },
      -              "startOffset": {
      -                "anyOf": [
      -                  {
      -                    "maximum": 9007199254740991,
      -                    "minimum": 0,
      -                    "type": "integer"
      -                  },
      -                  {
      -                    "type": "null"
      -                  }
      -                ]
      -              }
      -            },
      -            "required": [
      -              "citationId",
      -              "contractId",
      -              "contractTitle",
      -              "fileId",
      -              "chunkId",
      -              "fileName",
      -              "fileRole",
      -              "fileStatus",
      -              "startOffset",
      -              "endOffset"
      -            ],
      -            "type": "object"
      -          },
      -          "content": {
      -            "description": "Matched or sequential document text",
      -            "type": "string"
      -          },
      -          "context": {
      -            "anyOf": [
      -              {
      -                "type": "string"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ]
      -          }
      -        },
      -        "required": [
      -          "content",
      -          "citation"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    },
      -    "nextCursor": {
      -      "anyOf": [
      -        {
      -          "type": "string"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ]
      -    },
      -    "status": {
      -      "enum": [
      -        "ok",
      -        "missing",
      -        "ambiguous",
      -        "processing",
      -        "unindexed",
      -        "no_match",
      -        "exhausted",
      -        "invalid_cursor"
      -      ],
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "status",
      -    "completeness",
      -    "items",
      -    "nextCursor"
      -  ],
      -  "type": "object"
      -}New value: +null
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety bar is low; the description still adds real value by disclosing that matches come with a continuation cursor and that semantic/hybrid queries send content to an external embedding provider — a data-egress fact absent from annotations.

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?

Three tight sentences: purpose and scope first, sibling routing second, external-provider caveat last. No filler, and the most decision-relevant information is front-loaded.

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?

With no output schema, the description correctly notes what is returned (matches plus cursor). Combined with full schema coverage and strong annotations, an agent has what it needs; only details like cursor lifetime or pagination termination are left implicit.

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 coverage is 100%, so all seven parameters carry their own descriptions and the baseline is 3. The description reinforces mode semantics and cursor usage but adds no formats, ranges, or precedence rules (e.g. how contractId/documentId narrow scope) 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?

States a specific verb and resource ('Find cited passages across accessible documents') plus the three search modes, and explicitly contrasts with clm_read_contract_document for sequential reading. An agent can distinguish this from every sibling without opening a schema.

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?

Names the alternative tool and the condition that selects it ('to read a known document sequentially'), which is clear routing guidance. It does not spell out when to prefer exact vs. semantic vs. hybrid, though the mode enum's descriptions partially cover that.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.