Skip to main content
Glama

Upload a document to a shipment

upload_document
Idempotent

Changes data: attaches one file (a PDF, a JPEG, PNG or TIFF image, or an Excel or CSV spreadsheet, 50 MB at most) to a shipment, as the person who connected this app, and records it in the organization's audit log. Trackberry then reads it for extraction like any document uploaded on the site, so what it finds (parties, dates, goods) can show up on the shipment; use list_documents and get_document_data afterwards. Say which shipment and which file before calling, and only on the user's request. Name the shipment with shipment_id, or with container_number to use the live shipment that carries it; with neither, or with a container number no shipment carries, the file starts an untracked draft shipment. Give the file in exactly one way. In ChatGPT, pass the attached file as file. Otherwise give file_url, a public HTTPS link that Trackberry downloads once with no credentials. A link that needs a sign-in cannot be fetched (Microsoft 365, SharePoint and OneDrive links, Google Drive and Docs links that ask for a login, and similar share pages) and is refused with file_url_needs_sign_in; a direct download link that is public works. file_base64 with filename is a last resort for small files, 256 KB at most, because you would have to write out every byte. When you have no public URL and the file is not small, or you only hold such a sign-in link or an attachment you cannot pass (a Claude.ai or Microsoft Copilot chat attachment, say), call request_upload_link instead and give the user that link. Safe to repeat: the same file for the same shipment comes back as the document already attached, with created false. Answers with the document.

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_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoChatGPT's attached-file object. Pass the file the user attached as it is given to you.
file_urlNoA public HTTPS link to the file. Trackberry downloads it without credentials, so a link that needs a sign-in (SharePoint, OneDrive, Google Drive) does not work: use request_upload_link for those.
filenameNoThe file's name with its extension, such as "invoice.pdf". Required with file_base64; optional with file_url.
file_base64NoThe file's bytes, base64 encoded, 256 KB at most when decoded. A last resort for small files: it costs you the whole file as output.
shipment_idNoThe shipment to attach the file to, such as "shp_123", as returned by search_shipments. Not together with container_number.
container_numberNoInstead of shipment_id: an ISO 6346 container number such as "MSCU1234566". Uses the one live shipment that carries it, or starts a draft for it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / file_url / description
      Previous value: -"A public HTTPS link to the file. Trackberry downloads it without credentials, so a link that needs a login does not work."New value: +"A public HTTPS link to the file. Trackberry downloads it without credentials, so a link that needs a sign-in (SharePoint, OneDrive, Google Drive) does not work: use request_upload_link for those."
  2. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare the mutation and idempotency profile, yet the description still adds substantive context: attribution to the connecting user, audit-log recording, downstream extraction side effects (parties, dates, goods surfacing on the shipment), the file_url_needs_sign_in error code, and the untracked-draft fallback when no shipment is identified. The 'created false' repeat behavior is consistent with idempotentHint=true rather than contradicting it.

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?

The mutation warning and core action are front-loaded, and the mode-selection and alternative-tool guidance each carry real decision value. It is nevertheless a single dense block longer than typical, and the parenthetical client-specific examples (ChatGPT, Claude.ai, Copilot) add bulk that could be tightened.

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 six-parameter, nested-object mutation tool with no output schema, the description covers inputs, side effects, failure modes, and follow-up calls thoroughly. The only thin spot is the return value, dispatched in four words ('Answers with the document'), which leaves the response shape to inference.

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?

With 100% schema description coverage the schema already documents each parameter, including the shipment_id/container_number exclusion and the base64 size cap, so the baseline applies. The description does add some genuine meaning beyond the schema — 'give the file in exactly one way', and the otherwise undocumented case that supplying neither identifier starts an untracked draft shipment.

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 ('Chains data: attaches one file ... to a shipment') and immediately scopes the accepted file types and size ceiling. It is clearly distinguishable from siblings: request_upload_link is named for the cases this tool cannot handle, and list_documents/get_document_data are named as the follow-ups.

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 explicit when-to-use conditions ('Say which shipment and which file before calling, and only on the user's request'), explicit when-not conditions (sign-in links such as SharePoint/OneDrive/Google Drive, oversized files, unpassable chat attachments), and names the alternative tool (request_upload_link) to use instead. The choice among the three file-input modes is spelled out per environment.

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