Skip to main content
Glama

upload_document_image

Uploads a PNG, JPEG, or WebP image (up to 2 MiB before base64 encoding) to an existing document and returns its URL for insertion with save_document.

Instructions

Upload one PNG, JPEG or WebP image to an existing editable document. Send the file bytes as base64, up to 2 MiB before encoding. Insert the returned url as an image using save_document. If the result is lost, check attachments before uploading again.

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": {
      "documentId": "<documentId>",
      "filename": "<filename>",
      "mimeType": "<mimeType>",
      "contentBase64": "<contentBase64>"
    },
    "name": "upload_document_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameYesImage file name with extension and without path segments.
mimeTypeYesMIME type of the source image.
documentIdYesUUID returned by the corresponding list or read operation.
operationIdNoStable upload operation ID. Reuse with identical bytes and metadata after timeout to prevent duplicates. Requires WebP finalization on the server.
workspaceIdNoWorkspace UUID from list_workspace_structure(kind=workspaces). Required for ambiguous creates and structure changes; omit to search all granted scopes.
contentBase64YesBase64 file bytes without a data: prefix.

Output Schema

NameRequiredDescriptionDefault
idYes
urlYes
sizeYes
filenameYes
mimeTypeYes
documentIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.2.2
    • addedInput schema / properties / operationId
      Added value: +{
      +  "description": "Stable upload operation ID. Reuse with identical bytes and metadata after timeout to prevent duplicates. Requires WebP finalization on the server.",
      +  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
      +  "type": "string"
      +}
    • addedOutput schema / properties / documentId
      Added value: +{
      +  "format": "uuid",
      +  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +  "type": "string"
      +}
  2. Addedv2.1.9

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false, so the write nature is known; the description adds value with the 2 MiB pre-encoding ceiling and the lost-result recovery directive, which is consistent with idempotentHint=false. It does not describe permission requirements or failure modes for non-editable documents, so some behavioral surface remains uncovered.

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?

Four short sentences, front-loaded with the action and format before moving to constraints, the follow-up call, and the recovery path. No filler and nothing redundant with the annotations.

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?

With an output schema present, the description need not detail return values, and it only needs to reference the returned url, which it does. For a 6-parameter upload tool it covers format, size, and the post-upload workflow; only permission/error behavior is 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 all six parameters, including operationId deduplication semantics and workspaceId resolution, are already documented in the schema. The description restates the MIME whitelist and adds a practical 2 MiB pre-encoding limit that is only implicit in the schema's maxLength, but otherwise adds little parameter-level meaning beyond the schema baseline.

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 one PNG, JPEG or WebP image to an existing editable document') and immediately bounds the scope with format and size constraints. An agent can distinguish this from save_document (which inserts the result) and check_document_attachments (the recovery path) without opening any 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 explicitly routes the agent to the next step ('Insert the returned url as an image using save_document') and gives a recovery rule ('If the result is lost, check attachments before uploading again'), which is real when-to guidance. It stops short of stating exclusions, such as what to do if the document is not editable or if a duplicate already exists, so it is not a full 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.