Skip to main content
Glama

Upload File

upload_file

Upload a PDF file to Formify. Returns a fileId for use with create_document, create_draft or create_link. Provide exactly ONE of these inputs: (1) fileReference — a file reference that the host application supplies when the user attaches a file and the host supports passing files to tools. Pass it exactly as provided; the server downloads the bytes itself. Never construct one by hand and never put a local path in it. (2) url — a PDF reachable over HTTPS. Works in every client; use it whenever a URL is available. (3) uploadId — for an attached file when the host does not pass file references but you can execute shell commands: call request_file_upload_url first, run its curlCommand, then pass the uploadId here. (4) file — the file's bytes as base64 together with fileName, for an attached file when none of the above is possible. Practical ceiling is roughly 30–50 kB of PDF: base64 is a third larger than the file, and a 300 kB PDF would take more output than a model can emit in one message. IMPORTANT: Do NOT use base64 unless you can guarantee you are passing the complete, untruncated file content. AI assistants routinely truncate large strings, which silently corrupts the file and causes upload failures. If the user attached a file but no fileReference reached this tool, retry the call once before choosing another path. Max size: 50 MB. The PDF must not be password-protected or contain digital signatures from other services.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPublic URL to the PDF file (must be directly downloadable over HTTPS).
fileNoBase64-encoded PDF file content. Suited only to small files — roughly 30–50 kB of PDF; beyond that the string exceeds what can be emitted in one message and arrives truncated, producing a corrupt, unusable file. Only use this if you can guarantee the value is the complete, untruncated file. Prefer fileReference, url or uploadId.
fileNameNoFilename with extension (e.g. 'contract.pdf'). Required when using base64. Otherwise derived from the file reference, the URL or the staged upload if omitted.
uploadIdNoUpload ID from request_file_upload_url, after its curl command has returned HTTP 200.
fileReferenceNoA file reference supplied by the host application when the user attaches a file and the host supports passing files to tools. Pass the object exactly as the host provides it. If the host does not hand you such an object, leave this out and use url, uploadId or file (base64) instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / file / description
      Previous value: -"Base64-encoded PDF file content. WARNING: Only use this if you can guarantee the value is the complete, untruncated file. AI assistants often truncate large strings — a truncated base64 value will produce a corrupt, unusable file. Prefer uploadId or url."New value: +"Base64-encoded PDF file content. Suited only to small files — roughly 30–50 kB of PDF; beyond that the string exceeds what can be emitted in one message and arrives truncated, producing a corrupt, unusable file. Only use this if you can guarantee the value is the complete, untruncated file. Prefer fileReference, url or uploadId."
    • changedInput schema / properties / fileName / description
      Previous value: -"Filename with extension (e.g. 'contract.pdf'). Required when using base64. When using URL, derived from the URL if omitted."New value: +"Filename with extension (e.g. 'contract.pdf'). Required when using base64. Otherwise derived from the file reference, the URL or the staged upload if omitted."
    • addedInput schema / properties / fileReference
      Added value: +{
      +  "additionalProperties": true,
      +  "description": "A file reference supplied by the host application when the user attaches a file and the host supports passing files to tools. Pass the object exactly as the host provides it. If the host does not hand you such an object, leave this out and use url, uploadId or file (base64) instead.",
      +  "properties": {
      +    "download_url": {
      +      "description": "HTTPS URL from which the server downloads the file. Supplied by the host application — never construct one yourself.",
      +      "type": "string"
      +    },
      +    "file_id": {
      +      "description": "The host application's identifier for the attached file.",
      +      "type": "string"
      +    },
      +    "file_name": {
      +      "description": "Original filename reported by the host, if known.",
      +      "type": "string"
      +    },
      +    "mime_type": {
      +      "description": "MIME type reported by the host, if known.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "download_url",
      +    "file_id"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / properties / uploadId / description
      Previous value: -"Upload ID from request_file_upload_url. Use this for files attached to the conversation."New value: +"Upload ID from request_file_upload_url, after its curl command has returned HTTP 200."
    • changedInput schema / properties / url / description
      Previous value: -"Public URL to the PDF file (must be directly downloadable)."New value: +"Public URL to the PDF file (must be directly downloadable over HTTPS)."
  2. First observed

TDQS

A5/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, openWorldHint=true, destructiveHint=false), the description adds server-side download behavior, the 50 MB max size, the ban on password-protected or signed PDFs, and the silent-truncation risk with base64. It also includes a retry-once fallback when fileReference is missing. No contradiction with 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?

The description is front-loaded with purpose and return value, then organizes the four input modes in a numbered hierarchy. It is long, but every sentence carries constraint or decision information that an agent needs before calling the tool. No filler.

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

Completeness5/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 still states the return value (fileId) and the downstream tools that consume it. It covers prerequisites (request_file_upload_url), size limits, unsupported PDF features, and failure behavior, which is complete for safe invocation.

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?

Although the schema already documents all five parameters (100% coverage), the description adds operational meaning: exactly one of the four inputs must be supplied, the preferred order, 'pass it exactly as provided' for fileReference, and the practical 30–50 kB ceiling for base64. This goes well beyond the schema's structural descriptions.

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 and resource: 'Upload a PDF file to Formify. Returns a fileId for use with create_document, create_draft or create_link.' This clearly distinguishes the tool's role from sibling tools like create_document or merge_files, which consume files rather than upload them.

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?

It gives an explicit decision tree: use fileReference when the host supplies one, url whenever a URL is available, uploadId after request_file_upload_url returns its curlCommand, and base64 only as a last resort. It also states when not to act ('Do NOT use base64 unless...') and a retry rule, so an agent knows which path to choose in each context.

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.

Resources