Skip to main content
Glama

upload_product_image

Idempotent

Attach an image to an existing product by giving Partle a public URL to download the image from.

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

**When to use this tool**: the image is already hosted at a public URL
(a scraped product page, an Imgur link, a CDN URL the user provided).
Partle's server fetches it and stores it.

**When NOT to use this tool**: you have local image bytes (a file the
user attached, or bytes you generated/downloaded in your sandbox).
Sending those bytes through a tool argument blows past conversation
context limits — phone-photo-sized payloads can be 6+ MB of base64.
Instead, in your code-execution sandbox, POST the file directly to the
HTTP endpoint with multipart encoding:

  requests.post(
      "https://partle.rubenayla.xyz/v1/external/products/{product_id}/images",
      files={"file": open("/path/to/photo.jpg", "rb")},
      headers={"X-API-Key": "pk_..."},
  )

Or, to create the listing and attach an image in one HTTP request:

  requests.post(
      "https://partle.rubenayla.xyz/v1/external/products",
      data={"metadata": json.dumps({"name": ..., "price": ...})},
      files={"image": open("/path/to/photo.jpg", "rb")},
      headers={"X-API-Key": "pk_..."},
  )

Args:
    product_id: ID of the product to attach the image to.
    image_url: Publicly fetchable URL of the image. Server fetches it
        and stores 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:
    The created `ProductImage` record with its `id` (use for deletion)
    and storage path, or ``{"error": ...}`` on validation/auth failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNo
image_urlYes
product_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • removedInput schema / properties / content_type
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Content Type"
      -}
    • removedInput schema / properties / image_base64
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Image Base64"
      -}
    • removedInput schema / properties / image_url / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / image_url / default
      Removed value: -null
    • addedInput schema / properties / image_url / type
      Added value: +"string"
    • changedInput schema / required
      Previous value: -[
      -  "product_id"
      -]New value: +[
      +  "product_id",
      +  "image_url"
      +]
  2. Changed4 schema fields changed
    • addedInput schema / properties / api_key / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / api_key / default
      Added value: +null
    • removedInput schema / properties / api_key / type
      Removed value: -"string"
    • changedInput schema / required
      Previous value: -[
      -  "api_key",
      -  "product_id"
      -]New value: +[
      +  "product_id"
      +]
  3. First observed

TDQS

A5/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the server-side fetch-and-store behavior, authentication requirements and fallback, api_key override semantics, error behavior on invalid auth, and the return shape (ProductImage record with id and storage path). It is rich, candid behavioral detail well beyond the annotation booleans.

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?

The description is longer than average, but it is well-structured with headings, bullets, and pragmatic code examples. Every section earns its place: purpose, auth, decision guidance, argument details, and return behavior. Nothing is redundant or filler.

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?

Given the 3-parameter tool, no output schema, and the need for auth guidance, the description is complete. It covers when to use, when not to use, exact auth behavior, all parameters, and return/error shapes. It even provides complete alternative HTTP requests for the local-bytes case.

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?

Even though schema description coverage is 0%, the description's Args section fully explains product_id, image_url, and api_key in plain language. It adds critical semantics like 'server fetches it and stores it' and the nuanced api_key override behavior, which the raw schema cannot convey.

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 description opens with a clear, specific verb and resource: 'Attach an image to an existing product' and explains the mechanism (Partle fetches from a public URL). It is unmistakably distinct from siblings like delete_product_image or get_upload_url, and the name is reinforced by the fuller explanation.

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?

The description explicitly provides 'When to use this tool' and 'When NOT to use this tool' sections, including the alternative of posting directly to an HTTP endpoint for local bytes. This is exemplary guidance for selecting the right tool or avoiding it.

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.