Skip to main content
Glama

Upload file

upload_file

Upload a file, such as a supplier invoice PDF, sent as base64, and attach it to a record such as a bill in the same call. The file is stored as it is: stub does not read it into a new bill. Returns the file id; to attach it to another record later, use attach_file.

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": {
      "name": "<name>",
      "type": "<type>",
      "content": "<content>"
    },
    "name": "upload_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesFile name with its extension, for example invoice-1042.pdf
typeYesThe file's media type, for example application/pdf
entityNoThe kind of record entityid is: bill, expense, income, invoice. A bill or invoice id names its own kind.
contentYesThe file itself, base64 encoded. At most 5 MB once decoded.
entityidNoAttach the stored file to this record, for example a bill (cont-…). Omit to only store the file.
folderidNoFolder to file it in

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false; the description adds real behavioral context on top of that — the file is stored byte-for-byte and is not parsed into a new bill, so there is no hidden OCR or record creation. It also discloses the return value (the file id), though it says nothing about duplicate handling or failure modes.

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 the store-and-attach behavior, then the return value, then the sibling hand-off. Every clause carries information an agent needs, and nothing is padding.

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 6-parameter mutation tool with no output schema, the description covers what happens to the file, what it is attached to, what is returned, and where to go next. It omits folderid/folder semantics and any conflict or size-limit-rejection behavior, but the essentials for a correct call are present.

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% and the schema already explains name, type, base64 content with the 5 MB limit, and that omitting entityid only stores the file. The description reinforces the base64/attachment relationship but adds no syntax or format detail beyond what the schema states, so the baseline of 3 is appropriate.

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 names a specific verb and resource (upload a file, base64-encoded) and states the combined outcome: the file is stored and attached to a record such as a bill in the same call. It also distinguishes itself from the sibling attach_file, so an agent can route between them without opening either schema.

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

Usage Guidelines4/5

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

It gives clear conditions: use this to store-and-attach in one call, and switch to attach_file when attaching later to another record. It does not cover related alternatives such as list_files or whether a new bill should instead be created via save_document, so the routing picture is helpful but not exhaustive.

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