Skip to main content
Glama

delete_product_image

DestructiveIdempotent

Remove a specific image from a product. Destructive, idempotent.

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

Use when an image was uploaded by mistake or the merchant updated their
listing. The product itself is preserved — only the image record and its
file are removed. To remove the product entirely use `delete_product`.

Args:
    product_id: ID of the product the image belongs to.
    image_id: ID of the image to delete. Visible in the `images` array of
        `get_product` responses.
    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:
    ``{"deleted": True, "product_id": int, "image_id": int}`` on success,
    or ``{"error": ...}`` on auth/ownership failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNo
image_idYes
product_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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",
      -  "image_id"
      -]New value: +[
      +  "product_id",
      +  "image_id"
      +]
  2. Added

TDQS

A5/5.0
Behavior5/5

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

The description adds behavioral detail beyond the annotations: 'only the image record and its file are removed' and 'The product itself is preserved' clarifies the side-effect footprint. It also discloses nuanced auth behaviors (e.g., an explicitly passed key overrides a narrowly scoped token; invalid/revoked tokens still fail). No contradiction with 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?

The description is organized into clear sections (purpose, auth, use cases, params, returns), ensuring every sentence serves a distinct function. While somewhat long, the auth nuances and parameter explanations justify the length; no redundancy or fluff.

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 tool's destructive nature, auth complexity, and lack of an output schema, the description covers all essential aspects: when to use, side effects, parameter semantics, return format (`{'deleted': True, ...}`) and error behavior. It also references sibling tools for context, making it complete for an agent.

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?

Schema coverage is 0%, but the description thoroughly explains each parameter. `product_id` and `image_id` are defined with relationships (`image_id` is visible in `get_product` responses), and `api_key` receives an extensive explanation of its override/fallback behavior and failure modes. This fully compensates for the schema's lack of descriptions.

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 'Remove a specific image from a product,' a specific verb ('Remove') with a precise resource ('a specific image') and clear scope. It also explicitly differentiates from `delete_product` by stating 'To remove the product entirely use delete_product,' eliminating ambiguity between sibling tools.

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?

'Use when an image was uploaded by mistake or the merchant updated their listing' provides concrete trigger conditions. It also names the alternative tool (`delete_product`) and includes authentication guidance (OAuth scope vs `api_key` fallback), making when-to-use and when-not-to-use explicit.

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