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.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "upload_file"
  }
}

Input 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?

Annotations declare non-readonly, open-world, non-idempotent, and non-destructive behavior. The description adds server-side download behavior, return value semantics, size limits, PDF restrictions, truncation risks, and retry behavior without contradicting 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 purpose and return value are front-loaded in the first sentence, followed by clearly enumerated input modes and caveats. The length is justified by four mutually exclusive upload paths and several non-obvious failure modes.

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 explains the returned fileId and its intended use. It covers all parameters, input selection, size and format restrictions, security constraints, and retry behavior, making it complete for a complex upload tool.

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 schema description coverage is 100%, the description adds important selection logic and priority ordering among url, fileReference, uploadId, and base64 file. It also clarifies host-supplied fileReference constraints and the request_file_upload_url flow beyond what the schema states.

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 states a specific verb and resource: uploading a PDF to Formify. It also explains the return value and downstream tools (create_document, create_draft, create_link), making the tool's role distinct from sibling creation tools.

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 explicitly requires exactly one of four input modes and explains when each applies, including preference order and fallback behavior. It also gives retry guidance for attached files and names request_file_upload_url as a prerequisite for the uploadId path.

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