Skip to main content
Glama

Upload an email attachment

upload_email_attachment

Upload a small attachment for outbound email, as base64 text.

    Meant for small files (under about 50 KB): every base64 character goes
    through the tool call itself. Larger files go through ``create_file_upload``
    with ``purpose="email_attachment"``: its ``curl`` line sends the bytes, and its
    ``id`` works in ``send_email``'s ``attachment_ids``.
    Returns ``id``, ``filename``, ``content_type`` and ``size_bytes``.
    The ID is accepted in an email's ``attachment_ids`` and is reusable across sends.
    Unused uploads expire after 24 hours.
    The combined message and attachments must fit the 25 MB sending limit.

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": {
      "content_base64": "<content_base64>",
      "filename": "<filename>",
      "content_type": "<content_type>"
    },
    "name": "upload_email_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameYesFile name shown to recipients, such as ``invoice.pdf``.
llm_modelNoThe calling agent's provider model ID, as shown in the client's model configuration when available. Recorded for analytics.
content_typeYesThe file's MIME type, such as ``application/pdf``.
content_base64YesThe file's bytes, base64-encoded.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / llm_model / description
      Previous value: -"Model ID of the calling agent. Optional. Recorded for analytics only."New value: +"The calling agent's provider model ID, as shown in the client's model configuration when available. Recorded for analytics."
  2. Changed3 schema fields changed
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "description": "Returned by POST /email-attachments.\n\n``id`` is reusable across many ``POST /emails`` calls via\n``EmailCreate.attachment_ids`` until Hail garbage-collects it (24h\nif never referenced by a send).",
      +    "properties": {
      +      "content_type": {
      +        "description": "MIME type of the uploaded file.",
      +        "title": "Content Type",
      +        "type": "string"
      +      },
      +      "filename": {
      +        "description": "Original filename of the uploaded file.",
      +        "title": "Filename",
      +        "type": "string"
      +      },
      +      "id": {
      +        "description": "Reusable attachment id — pass it in EmailCreate.attachment_ids to attach it to a send.",
      +        "format": "uuid",
      +        "title": "Id",
      +        "type": "string"
      +      },
      +      "size_bytes": {
      +        "description": "Size of the uploaded file in bytes.",
      +        "title": "Size Bytes",
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "filename",
      +      "content_type",
      +      "size_bytes"
      +    ],
      +    "title": "EmailAttachmentUploadResponse",
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "error": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / title
      Removed value: -"upload_email_attachment_toolDictOutput"
  3. Changed1 schema field changed
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "Model ID of the calling agent. Optional. Recorded for analytics only.",
      +  "type": "string"
      +}
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the mutation/idempotency profile; the description adds the constraints that actually govern behavior: the 50 KB practical ceiling tied to inline base64, 24-hour expiry of unused uploads, ID reusability across sends, and the combined 25 MB sending limit. It also tells the agent what is returned, which matters because each call creates a new non-idempotent upload.

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 purpose and the size constraint, then routing, then return values and limits; every sentence carries information. Minor drag from bullet-style line breaks and backtick markup artifacts that read as documentation formatting rather than prompt-facing text.

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?

An output schema exists, yet the description still names the key returned fields and the ID's downstream use, plus expiry and size limits. For a four-parameter mutation tool, nothing an agent needs to call it correctly is missing.

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 meaning beyond the schema by explaining that every base64 character travels through the tool call itself, which is why content_base64 is size-bounded. It also implies filename/content_type appear in the response, though it doesn't discuss llm_model.

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 a small attachment for outbound email, as base64 text') and immediately scopes it to small files, which separates it from create_file_upload. An agent can distinguish the two 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 Guidelines5/5

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

Gives an explicit size threshold (under about 50 KB) and names the alternative tool plus the exact parameter to use there (purpose="email_attachment"), including how its result flows into send_email's attachment_ids. Both the when and the when-not are spelled out.

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.