Skip to main content
Glama

Upload one verified attachment chunk through MCP

mail_upload_attachment_chunk
Idempotent

Fallback for a hosted client whose code sandbox cannot make the raw HTTPS PUT returned by mail_prepare_attachment_uploads. Use only when that result says inband_upload.eligible=true. Read at most 8192 unchanged bytes from the original file at offset 0, encode that byte range once as standard padded RFC 4648 Base64, calculate SHA-256 over the same decoded range, and call this tool. Continue immediately from next_offset until complete=true without pausing to analyze, summarize or explain the file between calls. Every successful chunk renews a 10-minute idle window, bounded by 2 hours from prepare. A retry with the identical offset, bytes and chunk hash is idempotent. If one chunk fails integrity, reread and retry only that range. Never summarize, convert or recreate the file. This in-band fallback is limited to 262144 original bytes per prepared set; larger sets require raw PUT. After every attachment is ready, call mail_send_message with attachment_ids and the original idempotency_key.

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": {
      "attachment_id": "<attachment_id>",
      "offset": "<offset>",
      "content_base64": "<content_base64>",
      "chunk_sha256": "<chunk_sha256>"
    },
    "name": "mail_upload_attachment_chunk"
  }
}

Input Schema

NameRequiredDescriptionDefault
offsetYesZero-based original byte offset. Start at 0, then use next_offset from the previous successful response.
chunk_sha256YesLowercase SHA-256 of this decoded chunk only. The server also verifies the whole-file SHA-256 declared during prepare.
attachment_idYesAttachment ID returned by mail_prepare_attachment_uploads.
content_base64YesOne small unchanged byte range encoded once as standard padded RFC 4648 Base64. Do not include a data: prefix, whitespace, Markdown or file path.

Output Schema

NameRequiredDescriptionDefault
statusYes
completeYes
securityNo
next_offsetYes
attachment_idYes
expected_sizeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations, it discloses the session mechanics an agent cannot infer: each successful chunk renews a 10-minute idle window bounded by 2 hours from prepare, retries with identical offset/bytes/hash are idempotent, and only the failing range should be reread. This is consistent with idempotentHint=true and destructiveHint=false, with no contradiction.

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?

Front-loaded with the fallback condition, then ordered as read/encode/hash, loop, retry, limits, finish — a logical operational sequence with no filler. It is dense with many short imperative sentences, but each carries a distinct constraint rather than restating the schema.

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?

For a multi-call chunked uploader this covers everything an agent needs: preconditions, per-chunk payload construction, loop termination via complete=true, retry semantics, hard size ceiling, and the terminal send step. Return values are covered by the output schema, so their absence from the description is not a gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning: it caps the read at 8192 unchanged bytes per call, pins offset 0 as the start, and requires the SHA-256 over the same decoded range. It also forbids data: prefixes, whitespace and Markdown in the base64 payload, reinforcing intent beyond the schema constraints.

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?

States a specific verb and resource ('upload one verified attachment chunk'), and immediately frames it as a fallback path distinct from the raw HTTPS PUT handed out by mail_prepare_attachment_uploads. An agent can tell this apart from the prepare/send siblings without inspecting the schema.

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?

Gives an explicit triggering condition ('Use only when that result says inband_upload.eligible=true') plus an exclusion ('larger sets require raw PUT' above 262144 bytes). It also names the follow-on step, mail_send_message with attachment_ids and the original idempotency_key, so the whole workflow is routed.

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.