Skip to main content
Glama

Add contract documents

clm_add_contract_documents
DestructiveIdempotent

Add drafts/related documents or replace the effective primary on an editable contract. Returns document outcomes and processing details. Use clm_import_contracts to create new contracts; use this for documents belonging to an existing contract. No Parser credits.

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": {
      "id": "<id>",
      "idempotencyKey": "<idempotencyKey>",
      "documents": "<documents>"
    },
    "name": "clm_add_contract_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesID
documentsYesIntent-only sources; at most one replace per request.
allowDuplicateNoAllow duplicate document.
idempotencyKeyYesRetry key for this exact request

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / allowDuplicate / description
      Previous value: -"Allow duplicate linked document."New value: +"Allow duplicate document."
  2. Changed7 schema fields changed
    • changedInput schema / properties / allowDuplicate / description
      Previous value: -"Set to true only after the user has been told the document is already associated with a contract and has asked for it to be added anyway."New value: +"Allow duplicate linked document."
    • changedInput schema / properties / documents / description
      Previous value: -"Intent-only document sources. Submit at most one replace document per request."New value: +"Intent-only sources; at most one replace per request."
    • changedInput schema / properties / documents / items / oneOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "dataBase64": {
      -        "maxLength": 25690112,
      -        "minLength": 4,
      -        "type": "string"
      -      },
      -      "fileName": {
      -        "maxLength": 120,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "intent": {
      -        "enum": [
      -          "draft",
      -          "related",
      -          "replace"
      -        ],
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "inline",
      -        "type": "string"
      -      },
      -      "mimeType": {
      -        "maxLength": 120,
      -        "minLength": 1,
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "intent",
      -      "kind",
      -      "fileName",
      -      "mimeType",
      -      "dataBase64"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "downloadUrl": {
      -        "format": "uri",
      -        "type": "string"
      -      },
      -      "expiresAt": {
      -        "format": "date-time",
      -        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
      -        "type": "string"
      -      },
      -      "fileName": {
      -        "maxLength": 120,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "fileSize": {
      -        "exclusiveMinimum": 0,
      -        "maximum": 2147483647,
      -        "type": "integer"
      -      },
      -      "intent": {
      -        "enum": [
      -          "draft",
      -          "related",
      -          "replace"
      -        ],
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "remote",
      -        "type": "string"
      -      },
      -      "mimeType": {
      -        "maxLength": 120,
      -        "minLength": 1,
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "intent",
      -      "kind",
      -      "fileName",
      -      "mimeType",
      -      "fileSize",
      -      "downloadUrl"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "dataBase64": {
      +        "maxLength": 52953088,
      +        "minLength": 4,
      +        "type": "string"
      +      },
      +      "fileName": {
      +        "maxLength": 120,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "intent": {
      +        "enum": [
      +          "draft",
      +          "related",
      +          "replace"
      +        ],
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "inline",
      +        "type": "string"
      +      },
      +      "mimeType": {
      +        "maxLength": 120,
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "intent",
      +      "kind",
      +      "fileName",
      +      "mimeType",
      +      "dataBase64"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "downloadUrl": {
      +        "format": "uri",
      +        "type": "string"
      +      },
      +      "expiresAt": {
      +        "format": "date-time",
      +        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
      +        "type": "string"
      +      },
      +      "fileName": {
      +        "maxLength": 120,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "fileSize": {
      +        "exclusiveMinimum": 0,
      +        "maximum": 2147483647,
      +        "type": "integer"
      +      },
      +      "intent": {
      +        "enum": [
      +          "draft",
      +          "related",
      +          "replace"
      +        ],
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "remote",
      +        "type": "string"
      +      },
      +      "mimeType": {
      +        "maxLength": 120,
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "intent",
      +      "kind",
      +      "fileName",
      +      "mimeType",
      +      "fileSize",
      +      "downloadUrl"
      +    ],
      +    "type": "object"
      +  }
      +]
    • changedInput schema / properties / id / description
      Previous value: -"Existing contract identifier"New value: +"ID"
    • removedInput schema / properties / id / 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 / idempotencyKey / description
      Previous value: -"Stable retry key for this exact document request"New value: +"Retry key for this exact request"
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": false,
      -  "properties": {
      -    "documents": {
      -      "items": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "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": "Existing contract UUID",
      -            "type": "string"
      -          },
      -          "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": "Created contract file version UUID",
      -            "type": "string"
      -          },
      -          "intent": {
      -            "enum": [
      -              "draft",
      -              "related",
      -              "replace"
      -            ],
      -            "type": "string"
      -          },
      -          "processingState": {
      -            "enum": [
      -              "not_queued",
      -              "queued"
      -            ],
      -            "type": "string"
      -          },
      -          "role": {
      -            "enum": [
      -              "primary",
      -              "related"
      -            ],
      -            "type": "string"
      -          },
      -          "status": {
      -            "enum": [
      -              "draft",
      -              "effective"
      -            ],
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "contractId",
      -          "fileId",
      -          "intent",
      -          "role",
      -          "status",
      -          "processingState"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    }
      -  },
      -  "required": [
      -    "documents"
      -  ],
      -  "type": "object"
      -}New value: +null
  3. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructive, idempotent, and open-world behavior, so the description earns credit for what it adds: the editable-contract precondition, the fact that results come back as document outcomes plus processing details, and the 'No Parser credits' cost note. It stops short of saying what failure or partial-success looks like when one of several documents is rejected.

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 short sentences, front-loaded with the action and scope, followed by return behavior and sibling routing. No filler or repeated annotation text.

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 destructive, multi-document mutation the definition covers purpose, sibling routing, precondition, and rough response shape, and the schema fully documents the nested document variants. Minor gap: no guidance on how partial failures across up to 100 documents are reported.

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 the baseline is 3. The description adds some meaning by mapping intent values to outcomes ('replace the effective primary'), but says nothing about allowDuplicate, idempotencyKey retry semantics, or the inline-vs-remote document forms handled by 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?

Precise verb plus resource: adds draft/related documents or replaces the effective primary on an editable contract. It explicitly separates itself from clm_import_contracts, so an agent can route correctly without comparing schemas.

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

Usage Guidelines5/5

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

Explicitly names the alternative (clm_import_contracts) for creating new contracts and scopes this tool to documents belonging to an existing contract. The 'editable contract' condition adds a second selection criterion. Nothing material is left to inference.

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.