Skip to main content
Glama

Import a host attachment

upload_attachment

Import a file the user attached in the chat into fal storage. Only for the attachment file object the chat host supplied: pass it unchanged. Never pass an arbitrary web URL, a URL you found or constructed, or a sandbox path; public web files go to upload_file with 'url'. Use this instead of upload_file prepare_upload for chat attachments: a sandbox PUT often has no network access. The server downloads and uploads the actual bytes; no local path or curl is needed. Existing fal-hosted outputs can be reused directly. Does not save an asset record in fal Assets. A failed or uncertain upload must be checked before starting another upload.

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": {
      "file": "<file>"
    },
    "name": "upload_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYes
user_intentNoThe user's request that prompted this tool call, copied verbatim. Preserve their wording and constraints; do not summarize, infer missing details, or substitute your generation prompt. Omit when the original request text is unavailable. Agent-reported context, not verified conversation history.

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 supplied annotations (readOnlyHint=false, openWorldHint=true, idempotentHint=false, destructiveHint=false), the description discloses operative behavior: the server downloads and uploads the actual bytes so no local path or curl is involved, no asset record is created in fal Assets, existing fal-hosted outputs can be reused, and an uncertain upload must be verified before retrying. That is exactly the additional context annotations cannot carry.

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?

Purpose and the 'only for host-supplied attachment' constraint are front-loaded, and nearly every sentence carries rule-bearing content. There is some redundancy: the URL exclusion in the description overlaps the download_url field description in the schema, costing a little tightness.

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?

This is a non-idempotent write tool with no output schema, so the description must carry the operational burden, and it does: source of bytes, what is not created (no asset record), reuse of existing fal outputs, and failure-checking behavior. An agent has enough to call it correctly and safely without further inference.

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 description coverage is 50% and the nested file object's file_id and file_name fields carry no descriptions, so the description must compensate. It does add meaning for the file parameter ('pass it unchanged', never a constructed URL or sandbox path), though it never clarifies the role of file_id or file_name specifically.

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 first sentence names a specific verb and resource ('Import a file ... into fal storage') and immediately scopes it to the attachment object the chat host supplied. It is explicitly distinguished from upload_file and prepare_upload, so an agent can route between them 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 Guidelines5/5

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

It states when to use this tool, when not to ('Never pass an arbitrary web URL, a URL you found or constructed, or a sandbox path'), and where the excluded cases go ('public web files go to upload_file with url'). It also names prepare_upload as the inferior alternative for chat attachments and explains why (sandbox PUT often has no network access), plus a rule for retrying after a failed upload.

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