Skip to main content
Glama

Prepare Source Upload

prepare_source_upload

Create a staged source upload session and return temporary upload targets.

Returns an `upload_id` and one target per declared file (`url` and form
`fields`). Each target accepts a `multipart/form-data` POST containing
every entry of `fields` followed by the file bytes in the `file` field.
Upload URLs expire after an hour and accept only the declared byte size.
Staged files do not replace the agent's source until `complete_source_upload`
succeeds.

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": {
      "agent_id": "<agent_id>",
      "files": "<files>"
    },
    "name": "prepare_source_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesYesThe files to stage, each {"path": relative path, "size": bytes, "sha256": hex digest}. Either one archive (.tar.gz, .tgz, .tar), or up to 200 individual UTF-8 text files with their paths relative to the agent's root. At most 64 MB in total.
agent_idYesThe agent's stable ID, such as agt_1a2b3c4d, from list_agents.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare the non-read-only, non-destructive, non-open-world profile; the description adds substantive behavior beyond that: one-hour URL expiry, byte-size enforcement per target, the exact multipart/form-data body ordering (fields then file bytes), and the fact that staging is non-destructive to the live source until completion. These are precisely the operational facts an agent cannot get from the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the action and return shape, then the mechanics, then the expiry and non-finality caveats. Every sentence carries a distinct operational fact, and the caveat about complete_source_upload is placed where it matters most.

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?

There is no output schema, so the description carries the return-value burden and does so: upload_id plus one target per file with url and fields, and the content type. Combined with expiry and size limits, nothing an agent needs to execute the upload correctly appears to be missing.

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

Parameters3/5

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

Schema description coverage is 100%, with the files array, size, sha256, and agent_id all documented in-schema, so the baseline is 3. The description adds some meaning by tying 'declared byte size' to the size field as an enforced limit, but it does not otherwise elaborate parameter formats.

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 opening sentence uses a specific verb plus resource ('Create a staged source upload session') and immediately states the result ('return temporary upload targets'). It also implicitly separates this tool from complete_source_upload by noting staging is not final, so an agent can place it in the workflow without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

The two-step flow is made explicit: staged files do not replace the agent's source until complete_source_upload succeeds, which tells the agent this tool must be followed by that sibling. It stops short of stating prerequisites (auth requirements) or when one would skip staging entirely, so it is clear context without full when/when-not guidance.

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.