Skip to main content
Glama

Prepare contract document

clm_create_upload_url

Get upload URL, expiry and uploadReference. User files: after PUT, default to Import contracts with uploadReference for new-document imports via clm_import_contracts; external record sync: Sync contract from another system via clm_ingest_contract with the real externalSystem/externalId to preserve retry identity. For documents on an existing contract, use clm_add_contract_documents. Claude chat: panel first; sandbox PUT needs app-domain permission or no panel. Returns uploadCommand for a single PUT and uploadInstructions with transfer safety and fallback rules.

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": {
      "fileName": "<fileName>",
      "mimeType": "<mimeType>",
      "fileSize": "<fileSize>"
    },
    "name": "clm_create_upload_url"
  }
}

Input Schema

NameRequiredDescriptionDefault
sha256NoLowercase hex SHA-256; import rejects differing bytes
fileNameYesName + extension
fileSizeYesBytes
mimeTypeYesUpload file type; imports accept PDF, DOCX, TXT, JPEG, PNG or RTF

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "acceptedMimeTypes": {
      -        "description": "Document types contract imports accept",
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": "array"
      -      },
      -      "expiresAt": {
      -        "allOf": [
      -          {
      -            "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
      -          },
      -          {
      -            "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))$"
      -          }
      -        ],
      -        "description": "When uploadUrl stops accepting the file",
      -        "type": "string"
      -      },
      -      "expiresIn": {
      -        "exclusiveMinimum": 0,
      -        "maximum": 9007199254740991,
      -        "type": "integer"
      -      },
      -      "ifUploadUrlUnreachable": {
      -        "additionalProperties": false,
      -        "description": "Present when contract import is available on this connection",
      -        "properties": {
      -          "kind": {
      -            "const": "inline",
      -            "description": "File kind to send instead",
      -            "type": "string"
      -          },
      -          "maxBytes": {
      -            "description": "Largest inline file in bytes",
      -            "exclusiveMinimum": 0,
      -            "maximum": 9007199254740991,
      -            "type": "integer"
      -          },
      -          "note": {
      -            "description": "How the inline path relates to this upload destination",
      -            "type": "string"
      -          },
      -          "tool": {
      -            "description": "Tool that accepts the same file inline",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "tool",
      -          "kind",
      -          "maxBytes",
      -          "note"
      -        ],
      -        "type": "object"
      -      },
      -      "maxBytes": {
      -        "description": "Largest accepted document size in bytes",
      -        "exclusiveMinimum": 0,
      -        "maximum": 9007199254740991,
      -        "type": "integer"
      -      },
      -      "method": {
      -        "const": "PUT",
      -        "description": "HTTP method for uploadUrl",
      -        "type": "string"
      -      },
      -      "nextStep": {
      -        "description": "Client-specific document transfer steps",
      -        "type": "string"
      -      },
      -      "note": {
      -        "type": "string"
      -      },
      -      "requiredHeaders": {
      -        "additionalProperties": {
      -          "type": "string"
      -        },
      -        "description": "Headers the PUT must send with exactly these values",
      -        "properties": {},
      -        "propertyNames": {
      -          "type": "string"
      -        },
      -        "type": "object"
      -      },
      -      "status": {
      -        "const": "awaiting_upload",
      -        "description": "The reference holds no document until the PUT to uploadUrl succeeds",
      -        "type": "string"
      -      },
      -      "uploadCommand": {
      -        "type": "string"
      -      },
      -      "uploadInstructions": {
      -        "type": "string"
      -      },
      -      "uploadReference": {
      -        "description": "Opaque prepared document reference",
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "uploadUrl": {
      -        "minLength": 1,
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "uploadUrl",
      -      "expiresIn",
      -      "uploadCommand",
      -      "uploadInstructions",
      -      "uploadReference",
      -      "status",
      -      "method",
      -      "requiredHeaders",
      -      "expiresAt",
      -      "maxBytes",
      -      "acceptedMimeTypes"
      -    ]
      -  },
      -  {
      -    "additionalProperties": false,
      -    "else": {
      -      "required": [
      -        "action_url"
      -      ]
      -    },
      -    "if": {
      -      "properties": {
      -        "audience": {
      -          "const": "member"
      -        }
      -      }
      -    },
      -    "properties": {
      -      "action_url": {
      -        "format": "uri",
      -        "type": "string"
      -      },
      -      "audience": {
      -        "enum": [
      -          "billing_admin",
      -          "member"
      -        ]
      -      },
      -      "code": {
      -        "const": "billing_action_required"
      -      },
      -      "reason": {
      -        "enum": [
      -          "trial_cap_reached",
      -          "trial_ended",
      -          "subscription_ended",
      -          "payment_failed",
      -          "plan_limit_reached",
      -          "storage_full",
      -          "parser_credits_exhausted"
      -        ]
      -      },
      -      "retryable": {
      -        "const": false,
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "code",
      -      "reason",
      -      "audience"
      -    ],
      -    "then": {
      -      "not": {
      -        "required": [
      -          "action_url"
      -        ]
      -      }
      -    }
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "acceptedMimeTypes": {
      +        "description": "Document types contract imports accept",
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "expiresAt": {
      +        "allOf": [
      +          {
      +            "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
      +          },
      +          {
      +            "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))$"
      +          }
      +        ],
      +        "description": "When uploadUrl stops accepting the file",
      +        "type": "string"
      +      },
      +      "expiresIn": {
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      },
      +      "ifUploadUrlUnreachable": {
      +        "additionalProperties": false,
      +        "description": "Present when inline import is offered as the upload fallback",
      +        "properties": {
      +          "kind": {
      +            "const": "inline",
      +            "description": "File kind to send instead",
      +            "type": "string"
      +          },
      +          "maxBytes": {
      +            "description": "Largest inline file in bytes",
      +            "exclusiveMinimum": 0,
      +            "maximum": 9007199254740991,
      +            "type": "integer"
      +          },
      +          "note": {
      +            "description": "How the inline path relates to this upload destination",
      +            "type": "string"
      +          },
      +          "tool": {
      +            "description": "Tool that accepts the same file inline",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "tool",
      +          "kind",
      +          "maxBytes",
      +          "note"
      +        ],
      +        "type": "object"
      +      },
      +      "maxBytes": {
      +        "description": "Largest accepted document size in bytes",
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      },
      +      "method": {
      +        "const": "PUT",
      +        "description": "HTTP method for uploadUrl",
      +        "type": "string"
      +      },
      +      "nextStep": {
      +        "description": "Client-specific document transfer steps",
      +        "type": "string"
      +      },
      +      "note": {
      +        "type": "string"
      +      },
      +      "requiredHeaders": {
      +        "additionalProperties": {
      +          "type": "string"
      +        },
      +        "description": "Headers the PUT must send with exactly these values",
      +        "properties": {},
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      },
      +      "status": {
      +        "const": "awaiting_upload",
      +        "description": "The reference holds no document until the PUT to uploadUrl succeeds",
      +        "type": "string"
      +      },
      +      "uploadCommand": {
      +        "type": "string"
      +      },
      +      "uploadInstructions": {
      +        "type": "string"
      +      },
      +      "uploadReference": {
      +        "description": "Opaque prepared document reference",
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "uploadUrl": {
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "uploadUrl",
      +      "expiresIn",
      +      "uploadCommand",
      +      "uploadInstructions",
      +      "uploadReference",
      +      "status",
      +      "method",
      +      "requiredHeaders",
      +      "expiresAt",
      +      "maxBytes",
      +      "acceptedMimeTypes"
      +    ]
      +  },
      +  {
      +    "additionalProperties": false,
      +    "else": {
      +      "required": [
      +        "action_url"
      +      ]
      +    },
      +    "if": {
      +      "properties": {
      +        "audience": {
      +          "const": "member"
      +        }
      +      }
      +    },
      +    "properties": {
      +      "action_url": {
      +        "format": "uri",
      +        "type": "string"
      +      },
      +      "audience": {
      +        "enum": [
      +          "billing_admin",
      +          "member"
      +        ]
      +      },
      +      "code": {
      +        "const": "billing_action_required"
      +      },
      +      "reason": {
      +        "enum": [
      +          "trial_cap_reached",
      +          "trial_ended",
      +          "subscription_ended",
      +          "payment_failed",
      +          "plan_limit_reached",
      +          "storage_full",
      +          "parser_credits_exhausted"
      +        ]
      +      },
      +      "retryable": {
      +        "const": false,
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "code",
      +      "reason",
      +      "audience"
      +    ],
      +    "then": {
      +      "not": {
      +        "required": [
      +          "action_url"
      +        ]
      +      }
      +    }
      +  }
      +]
  2. Changed12 schema fields changed
    • changedInput schema / properties / fileName / description
      Previous value: -"Original file name including extension"New value: +"Name + extension"
    • changedInput schema / properties / fileSize / description
      Previous value: -"File size in bytes"New value: +"Bytes"
    • changedInput schema / properties / fileSize / maximum
      Previous value: -9007199254740991New value: +52428800
    • changedInput schema / properties / mimeType / description
      Previous value: -"File type of the uploaded document"New value: +"Upload file type; imports accept PDF, DOCX, TXT, JPEG, PNG or RTF"
    • addedInput schema / properties / mimeType / enum
      Added value: +[
      +  "application/pdf",
      +  "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
      +  "text/plain",
      +  "image/jpeg",
      +  "image/png",
      +  "text/rtf",
      +  "application/rtf"
      +]
    • removedInput schema / properties / mimeType / minLength
      Removed value: -1
    • addedInput schema / properties / sha256
      Added value: +{
      +  "description": "Lowercase hex SHA-256; import rejects differing bytes",
      +  "pattern": "^[a-f0-9]{64}$",
      +  "type": "string"
      +}
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedOutput schema / additionalProperties
      Removed value: -false
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "acceptedMimeTypes": {
      +        "description": "Document types contract imports accept",
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "expiresAt": {
      +        "allOf": [
      +          {
      +            "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
      +          },
      +          {
      +            "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))$"
      +          }
      +        ],
      +        "description": "When uploadUrl stops accepting the file",
      +        "type": "string"
      +      },
      +      "expiresIn": {
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      },
      +      "ifUploadUrlUnreachable": {
      +        "additionalProperties": false,
      +        "description": "Present when contract import is available on this connection",
      +        "properties": {
      +          "kind": {
      +            "const": "inline",
      +            "description": "File kind to send instead",
      +            "type": "string"
      +          },
      +          "maxBytes": {
      +            "description": "Largest inline file in bytes",
      +            "exclusiveMinimum": 0,
      +            "maximum": 9007199254740991,
      +            "type": "integer"
      +          },
      +          "note": {
      +            "description": "How the inline path relates to this upload destination",
      +            "type": "string"
      +          },
      +          "tool": {
      +            "description": "Tool that accepts the same file inline",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "tool",
      +          "kind",
      +          "maxBytes",
      +          "note"
      +        ],
      +        "type": "object"
      +      },
      +      "maxBytes": {
      +        "description": "Largest accepted document size in bytes",
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      },
      +      "method": {
      +        "const": "PUT",
      +        "description": "HTTP method for uploadUrl",
      +        "type": "string"
      +      },
      +      "nextStep": {
      +        "description": "Client-specific document transfer steps",
      +        "type": "string"
      +      },
      +      "note": {
      +        "type": "string"
      +      },
      +      "requiredHeaders": {
      +        "additionalProperties": {
      +          "type": "string"
      +        },
      +        "description": "Headers the PUT must send with exactly these values",
      +        "properties": {},
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      },
      +      "status": {
      +        "const": "awaiting_upload",
      +        "description": "The reference holds no document until the PUT to uploadUrl succeeds",
      +        "type": "string"
      +      },
      +      "uploadCommand": {
      +        "type": "string"
      +      },
      +      "uploadInstructions": {
      +        "type": "string"
      +      },
      +      "uploadReference": {
      +        "description": "Opaque prepared document reference",
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "uploadUrl": {
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "uploadUrl",
      +      "expiresIn",
      +      "uploadCommand",
      +      "uploadInstructions",
      +      "uploadReference",
      +      "status",
      +      "method",
      +      "requiredHeaders",
      +      "expiresAt",
      +      "maxBytes",
      +      "acceptedMimeTypes"
      +    ]
      +  },
      +  {
      +    "additionalProperties": false,
      +    "else": {
      +      "required": [
      +        "action_url"
      +      ]
      +    },
      +    "if": {
      +      "properties": {
      +        "audience": {
      +          "const": "member"
      +        }
      +      }
      +    },
      +    "properties": {
      +      "action_url": {
      +        "format": "uri",
      +        "type": "string"
      +      },
      +      "audience": {
      +        "enum": [
      +          "billing_admin",
      +          "member"
      +        ]
      +      },
      +      "code": {
      +        "const": "billing_action_required"
      +      },
      +      "reason": {
      +        "enum": [
      +          "trial_cap_reached",
      +          "trial_ended",
      +          "subscription_ended",
      +          "payment_failed",
      +          "plan_limit_reached",
      +          "storage_full",
      +          "parser_credits_exhausted"
      +        ]
      +      },
      +      "retryable": {
      +        "const": false,
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "code",
      +      "reason",
      +      "audience"
      +    ],
      +    "then": {
      +      "not": {
      +        "required": [
      +          "action_url"
      +        ]
      +      }
      +    }
      +  }
      +]
    • removedOutput schema / properties
      Removed value: -{
      -  "expiresIn": {
      -    "description": "Number of seconds until the signed URL expires",
      -    "exclusiveMinimum": 0,
      -    "maximum": 9007199254740991,
      -    "type": "integer"
      -  },
      -  "r2Key": {
      -    "description": "Opaque object key for the uploaded file. Pass this back to `POST /contracts/ingest`.",
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  "uploadUrl": {
      -    "description": "Single-use signed URL for HTTP PUT upload",
      -    "minLength": 1,
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "r2Key",
      -  "uploadUrl",
      -  "expiresIn"
      -]
  3. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only declare a non-destructive, non-idempotent, non-open-world write. The description adds real behavioral context beyond that: this tool mints a URL rather than uploading, it returns uploadCommand for a single PUT plus uploadInstructions covering transfer safety and fallbacks, and sandbox PUT requires app-domain permission or no panel. It does not state URL lifetime or whether a reference/URL may be reused after the PUT, which keeps it from a 5.

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?

Return values are front-loaded, then routing, then the chat/sandbox caveat — a sensible order with no filler sentences. The middle sections are telegraphic fragments ('external record sync: Sync contract from another system...', 'Claude chat: panel first'), which costs some readability but not correctness.

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?

An output schema exists, so the description is not obligated to enumerate return fields, yet it still flags uploadCommand and uploadInstructions so the agent knows to read them. Combined with full routing guidance this is close to sufficient; only the validity window of the returned URL and reuse semantics are left unstated.

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 fileName, mimeType, fileSize and sha256 are already documented, and the baseline of 3 applies. The description adds workflow meaning to uploadReference (thread it into clm_import_contracts) but says nothing about sha256's role in the import handshake beyond what the schema states, and mentions externalSystem/externalId which are not parameters of this tool.

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 opening sentence names the specific artifact produced (upload URL, expiry, uploadReference) rather than restating the name. It then explicitly separates this tool from three siblings (clm_import_contracts, clm_ingest_contract, clm_add_contract_documents) so an agent can route without opening other 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?

Usage is stated as explicit branches: user files go to import, external-system sync goes to clm_ingest_contract with externalSystem/externalId, documents on an existing contract go to clm_add_contract_documents, and Claude chat should check the panel first. Each branch names the condition that selects it, which is exactly what when-to-use guidance should do.

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.