Skip to main content
Glama

Prepare an upload (signed URL)

prepare_upload
Idempotent

Reserve a single-use signed URL for a heavy upload (a local file).

Five purposes:

  • purpose='action' — the action itself takes bytes (facebook_ads.image_upload, facebook_insights.photo_upload / video_upload, a custom-audience CSV). Pass action (the SAME ref list_actions/execute_action use) and the account_id from list_accounts. POSTing the bytes RUNS the action and returns its result. Refused with a hint when the action is URL-only.

  • purpose='public_url' — the action only fetches a URL (Instagram media_create image_url/video_url, any *_url param). Pass path as the file name (e.g. 'photo.jpg'); the POST answers with a public, permanent asset_url to pass to the action. Set convert_to_jpeg in the POST for Instagram images (JPEG only).

  • purpose='report_asset' — an image inside a hosted report bundle; pass report_id and path.

  • purpose='report_source' — a file publish_report_spec takes by reference instead of in its arguments: a custom section's TSX (path='Ticker.tsx'), a spec or a JSON patch (.json). POST {"params": {"content": "<text>"}}; the answer's source_ref goes in custom_sections_ref / spec_ref / patch_ref (yours alone, 2 h, ≤ 256 KB).

  • purpose='domain_logo' — the brand logo of a connected custom domain (PNG/JPEG ≤ 512 KB; shown as the browser-tab icon and on the sign-in page under that domain). Pass hostname (from manage_report_domain list) and path (the file name, e.g. 'logo.png'). Owner/admin + paid plan. Returns {upload_url, method, headers, expires_in, max_size_bytes, input_schema, how_to_post, next_step}; POST the JSON body to upload_url from a code-execution channel (never through the chat).

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": {
      "purpose": "<purpose>"
    },
    "name": "prepare_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNo
actionNo
purposeYes
hostnameNo
connectorNo
report_idNo
account_idNo
ttl_secondsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, idempotentHint=true, openWorldHint=true, destructiveHint=false), the description discloses the two-phase flow (reserve, then POST from a code-execution channel — "never through the chat"), single-use URLs, size ceilings (≤256 KB source refs, ≤512 KB logos), a 2 h ownership window, and the owner/admin + paid-plan requirement for domain logos.

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?

The lead sentence front-loads the core action, and the five purposes are cleanly bulleted with the purpose key in code formatting so an agent can scan to its case. It is dense and longer than most definitions, but nearly every clause carries operational detail; only the trailing return-field enumeration is arguably redundant with the output schema.

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?

For a mutation-ish, open-world, 8-parameter tool this covers the full call sequence, permissions, limits, and expiry, which is what an agent needs to invoke it correctly; the output schema already covers return values. The only omissions are the semantics of `connector` and `ttl_seconds`.

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 0% across 8 parameters, so the description carries the burden and mostly succeeds: it explains purpose (all five values), path (as file name), action (same ref list_actions/execute_action use), account_id, report_id, and hostname, including per-purpose applicability. It leaves `connector` and `ttl_seconds` entirely unmentioned, which is the remaining gap.

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 ("Reserve a single-use signed URL for a heavy upload") and then enumerates the five distinct purposes, each tied to a named sibling flow (execute_action, list_actions, list_accounts, publish_report_spec, manage_report_domain). An agent can distinguish this tool from execute_action or publish_report_spec 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?

Gives explicit when-to-use routing for every purpose value: action-taking bytes, URL-only fetch targets, report bundle images, spec/TSX sources by reference, and domain logos. It even states the exclusion case — the action is "Refused with a hint when the action is URL-only" — which routes the agent to purpose='public_url' instead.

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