Skip to main content
Glama

Search contract documents

clm_search_contract_documents
Read-onlyIdempotent

Search accessible text for cited exact/semantic/hybrid matches. Semantic/hybrid queries reach an external embedding provider.

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

B3.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower. The description nevertheless adds a genuinely valuable disclosure not present in structured fields: semantic/hybrid queries send content to an external embedding provider, which is a data-egress consideration an agent should factor in before choosing a mode.

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?

Two tight sentences, front-loaded with the core action and followed by the external-provider disclosure. Slightly dense phrasing ("cited exact/semantic/hybrid matches") costs a little readability but nothing is wasted.

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?

With 7 parameters, an enum, and no output schema, the definition covers the essential action and one important behavioral caveat. It leaves unexplained what "cited" matches mean in the result, how the cursor paginates, and what includeRelated actually pulls in, all of which the schema only partially clarifies.

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 100%, so all seven parameters are already documented in the schema, making 3 the baseline. The description reinforces the meaning of the mode values but adds no syntax, cursor lifecycle, or contractId/documentId relationship detail beyond the schema.

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?

States a specific verb ("Search") and resource ("accessible text" within contract documents), and enumerates the three match modes. It distinguishes itself reasonably from read-oriented siblings like clm_read_contract_document by being a query tool, though it never names an alternative explicitly.

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

Usage Guidelines2/5

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

There is no explicit when-to-use guidance, no when-not conditions, and no named alternatives among the many siblings (e.g. clm_read_contract_document, clm_search_tools). The mode names hint at query intent, but the agent must infer when a search is preferable to reading a document directly.

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.