Skip to main content
Glama

get_upload_url

Idempotent

Mint a one-shot signed upload URL for a product you own.

Authenticated. OAuth (scope `products:write`) preferred; `api_key` fallback.

Use this when you have **local image bytes** (a file the user attached,
bytes you generated/downloaded in your sandbox) and you want to attach
them to a product that already exists. Common cases:

- `create_product` returned 409 (duplicate name) — the listing already
  exists; this tool gives you an upload URL for it without creating
  anything new.
- You're adding a 2nd, 3rd, … photo to a product.

The returned URL is valid for ~15 min, single product, signed with
your authenticated identity. From your sandbox, do **one PUT**:

  requests.put(result["upload_url"],
               data=open("/path/to/photo.jpg", "rb").read(),
               headers={"Content-Type": "image/jpeg"})

No auth header on that PUT — the URL is the credential.

If you have a public URL (not local bytes), use
`upload_product_image(product_id, image_url=...)` instead.

Args:
    product_id: Product to attach the future image to. You must own it.
    api_key: Optional API key (`pk_*`, generate at /account).
        Used when there is no OAuth token, and also when the OAuth
        token lacks the required scope — an explicitly passed key
        overrides an ambient token that is scoped too narrowly.
        An invalid or revoked token still fails regardless. Omit when using OAuth.

Returns:
    ``{"upload_url": str, "upload_expires_in": int}``, or
    ``{"error": ...}`` on auth/ownership failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNo
product_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A5/5.0
Behavior5/5

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

Discloses auth requirements ('OAuth (scope products:write) preferred; api_key fallback'), URL validity (~15 min), one-shot nature, and the fact that no auth header is needed on the PUT because the URL is the credential. It also explains api_key override semantics and error behavior, going well beyond 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?

Though lengthy, it front-loads the main purpose in the first sentence and then organizes into use cases, PUT instructions, args, and returns. Each section adds necessary information; the code snippet is a concrete example.

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?

The tool has no output schema, so the description includes the return format (`{upload_url, upload_expires_in}` and error case). It covers auth, use cases, and exact HTTP call, making it complete for a 2-param tool.

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?

With 0% schema description coverage, the description fully compensates: product_id is defined as the product to attach to and 'You must own it.' api_key is explained in detail, including when to use it (no OAuth token or missing scope) and override behavior.

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 it 'Mint[s] a one-shot signed upload URL for a product you own' – a specific verb and resource. The description clearly distinguishes it from sibling `upload_product_image` by scoping to local bytes vs public URL.

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 says 'Use this when you have local image bytes' and gives common cases (409 from create_product, adding additional photos). It names the alternative: 'If you have a public URL (not local bytes), use upload_product_image(...)'.

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.