Skip to main content
Glama

Mailrun Agent Identity

Upload a knowledge file

upload_knowledge
Idempotent

Give the identity's hosted phone agent a document to answer callers from: PDF, DOCX, plain text, Markdown, CSV or HTML, at most 20 MB. Send the file as upload_id (preferred: prepare_upload, then PUT the file from your shell so its bytes never pass through your context) or as content_base64 for a tiny file. The type is detected from the bytes; the text is extracted here and stored with the voice service. Only upload information the owner would tell any caller: a released reply cannot be retracted. Limits: 5 files and 25,000 tokens of extracted text (about 40 pages) per identity. Uploading the same document again returns the stored file with deduplicated true (nothing new is stored). warnings lists filename_type_mismatch when the file name's extension does not match the detected type (the detected type is stored). A truncated or corrupt document is refused, never stored partly. Takes effect on the next call. Returns metadata only; do not repeat the base64 back to the user. The extracted text is screened on save like the hosted prompt: high-risk content (scam, impersonation of a bank, government body or utility, collections abuse, deception) is refused hosted_content_rejected with the reason and not stored; borderline content is accepted and reviewed (screening in the result).

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": {
      "identity_id": "<identity_id>"
    },
    "name": "upload_knowledge"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameNoThe file name with its extension (required with content_base64; used to tell Markdown, CSV and HTML from plain text).
upload_idNoA received upload from prepare_upload (purpose knowledge); its prepared filename is used unless filename is given. Use this or content_base64, not both.
identity_idYesIdentity id from list_identities.
content_base64NoBase64 of the document bytes, for tiny files only; prefer upload_id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations, which only mark this as non-read-only, idempotent and non-destructive. It discloses dedup semantics ('deduplicated true, nothing new is stored'), permission-independent content screening with a named error code (hosted_content_rejected), refusal of truncated/corrupt files rather than partial storage, quota limits (5 files / 25,000 tokens), activation timing (next call), and the filename_type_mismatch warning.

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, then transport mechanism, then limits, then failure modes — a sensible order with no filler sentences. It is a dense single block, however, and the screening clause at the end is long enough that an agent skimming may miss it; a break into short lines would help.

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?

With no output schema, the description compensates by describing return content (metadata only, deduplicated flag, warnings list, screening result) and by warning not to echo base64 back. Combined with quotas, failure modes and activation timing, nothing an agent needs to call this correctly is missing.

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

Parameters5/5

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

Schema coverage is already 100%, so the baseline is 3, but the description adds real meaning: it names upload_id as preferred with the prepare_upload dependency, frames content_base64 as for tiny files only, and explains that the type is detected from bytes while filename disambiguates Markdown/CSV/HTML. The 20 MB ceiling is a parameter-relevant constraint absent from the schema.

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 action on a specific resource: give the identity's hosted phone agent a document to answer callers from, with accepted formats and size limit enumerated. An agent can tell this apart from prepare_upload (a prerequisite step) and from the greeting/voicemail tools by resource alone.

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?

Explicitly names the preferred path (prepare_upload then PUT from a shell) versus the fallback (content_base64 for a tiny file) and the 'use this or content_base64, not both' rule. It also sets the when-not condition: only upload information the owner would tell any caller, since a released reply cannot be retracted.

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