Skip to main content
Glama

Search Products By Uploaded Image

products.search.image_upload
Read-only

Upload a local image file (or base64 string) and search PoloPan catalog products using visual image similarity. Returns matching products with available in-stock sizes, pricing, and verified purchase URLs (https://s.polopan.com/p/{handle}). Automatically localized to active country / 240+ destination regions.

PURPOSE & DISAMBIGUATION:

  • Performs reverse visual search by uploading a local or base64-encoded image to secure temporary storage, then querying visual embeddings.

  • Distinct from 'products.search.image_url': Use this tool when the image file is local on the user's machine or in base64 format, NOT already on a public URL.

  • Distinct from 'vision.outfit.detect_pieces': Use this tool to search for products matching a single garment, NOT for decomposing full multi-piece outfits into bounding boxes.

WHEN TO USE:

  • When a user uploads a local photo/screenshot or supplies base64 image data to find matching fashion products in the catalog.

WHEN NOT TO USE:

  • Do NOT use when the image is already accessible via a public web URL (use 'products.search.image_url').

  • Do NOT use for text-only searches (use 'products.search.text').

BEHAVIOR & SAFETY:

  • Read-only catalog query with temporary image upload artifact (automatically expires after 'expiry_hours', default 24h).

  • Resolves MIME types automatically if not explicitly provided.

  • Enriches all returned items with verified PoloPan purchase links and stock metadata.

PARAMETERS & CONSTRAINTS:

  • 'image_path' (string, optional): Local file system path to the image file (one of image_path or image_base64 is required).

  • 'image_base64' (string, optional): Base64-encoded image data string.

  • 'country' (string, optional): Target country name, city, currency, or ISO-2 code (e.g. 'US', 'United States', 'UK', 'Dubai', 'CA', 'IN'). Defaults to active saved region.

  • 'mode' (enum, optional): Catalog mode: 'global' (ships to country) or 'local' (domestic only).

  • 'content_type' (string, default 'image/jpeg'): MIME type of the uploaded image (e.g. 'image/jpeg', 'image/png', 'image/webp').

  • 'expiry_hours' (integer 1-168, default 24): Temporary upload lifetime in hours before expiration.

  • 'page' (integer >= 1, default 1): Pagination page number.

  • 'page_size' (integer 1-100, default 20): Number of items per page.

  • 'sort_by' (enum, default 'relevance'): Sorting attribute ('relevance', 'price', 'title').

  • 'sort_order' (enum, default 'desc'): Sort direction ('asc' or 'desc').

  • 'gender' (string, optional): Target gender filter ('men', 'women', or 'unisex').

  • 'size' (array of strings, optional): Size filter array.

  • 'price_min' (number, optional): Minimum price threshold.

  • 'price_max' (number, optional): Maximum price threshold.

  • 'vendor' (array of strings, optional): Brand filter array.

  • 'personalize' (boolean, default false): Whether to personalize search ranking.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "products.search.image_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoCatalog mode: 'global' (ships to country) or 'local' (domestic only). Defaults to active saved region.
pageNoPagination page number (1-indexed)
sizeNoArray of sizes to filter by
genderNoTarget gender filter: 'men', 'women', or 'unisex'
vendorNoList of brand names to filter by
countryNoCountry name, city, currency, or 2-letter ISO code (e.g. 'US', 'United States', 'UK', 'Dubai', 'CA', 'IN'). Defaults to active saved region.
sort_byNoSorting criteria: 'relevance', 'price', or 'title'relevance
image_urlNoOptional public HTTP(S) image URL if already hosted
page_sizeNoNumber of items to return per page (1 to 100, default 20)
price_maxNoMaximum price in local currency
price_minNoMinimum price in local currency
image_pathNoLocal file system path to the image file (e.g. '/path/to/dress.jpg')
sort_orderNoSort order: 'asc' or 'desc'desc
personalizeNoWhether to apply personalized ranking weights
content_typeNoMIME type of the image, e.g. 'image/jpeg', 'image/png', 'image/webp'image/jpeg
expiry_hoursNoTemporary upload URL lifetime in hours before expiration (1 to 168, default 24)
image_base64NoBase64-encoded image data string (alternative to image_path)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / image_url
      Added value: +{
      +  "description": "Optional public HTTP(S) image URL if already hosted",
      +  "format": "uri",
      +  "type": "string"
      +}
  2. Changed16 schema fields changed
    • changedInput schema / properties / content_type / description
      Previous value: -"MIME type of the image, e.g. 'image/jpeg', 'image/png'"New value: +"MIME type of the image, e.g. 'image/jpeg', 'image/png', 'image/webp'"
    • addedInput schema / properties / country
      Added value: +{
      +  "description": "Country name, city, currency, or 2-letter ISO code (e.g. 'US', 'United States', 'UK', 'Dubai', 'CA', 'IN'). Defaults to active saved region.",
      +  "type": "string"
      +}
    • changedInput schema / properties / expiry_hours / description
      Previous value: -"Temporary upload URL lifetime in hours"New value: +"Temporary upload URL lifetime in hours before expiration (1 to 168, default 24)"
    • changedInput schema / properties / gender / description
      Previous value: -"Target gender filter"New value: +"Target gender filter: 'men', 'women', or 'unisex'"
    • changedInput schema / properties / image_base64 / description
      Previous value: -"Base64-encoded image data string"New value: +"Base64-encoded image data string (alternative to image_path)"
    • changedInput schema / properties / image_path / description
      Previous value: -"Local file system path to the image file"New value: +"Local file system path to the image file (e.g. '/path/to/dress.jpg')"
    • addedInput schema / properties / mode
      Added value: +{
      +  "description": "Catalog mode: 'global' (ships to country) or 'local' (domestic only). Defaults to active saved region.",
      +  "enum": [
      +    "global",
      +    "local"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / page / description
      Previous value: -"Page number for pagination"New value: +"Pagination page number (1-indexed)"
    • changedInput schema / properties / page_size / description
      Previous value: -"Number of items to return per page"New value: +"Number of items to return per page (1 to 100, default 20)"
    • changedInput schema / properties / personalize / description
      Previous value: -"Whether to personalize search ranking"New value: +"Whether to apply personalized ranking weights"
    • changedInput schema / properties / price_max / description
      Previous value: -"Maximum price"New value: +"Maximum price in local currency"
    • addedInput schema / properties / price_max / minimum
      Added value: +0
    • changedInput schema / properties / price_min / description
      Previous value: -"Minimum price"New value: +"Minimum price in local currency"
    • addedInput schema / properties / price_min / minimum
      Added value: +0
    • changedInput schema / properties / sort_by / description
      Previous value: -"Sorting criteria"New value: +"Sorting criteria: 'relevance', 'price', or 'title'"
    • changedInput schema / properties / vendor / description
      Previous value: -"List of brand names"New value: +"List of brand names to filter by"
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": false,
      -  "properties": {
      -    "products": {
      -      "description": "Matching products",
      -      "items": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "handle": {
      -            "description": "Product handle",
      -            "type": "string"
      -          },
      -          "price": {
      -            "description": "Price",
      -            "type": "number"
      -          },
      -          "title": {
      -            "description": "Product title",
      -            "type": "string"
      -          },
      -          "url": {
      -            "description": "Purchase link",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "handle",
      -          "title",
      -          "price",
      -          "url"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    },
      -    "uploaded_image_url": {
      -      "description": "Temporary URL of the uploaded image",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "uploaded_image_url",
      -    "products"
      -  ],
      -  "type": "object"
      -}New value: +null
  4. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description is consistent with them while adding real context: the image is copied to secure temporary storage that expires after expiry_hours, MIME types are auto-resolved, and results are enriched with verified purchase links and stock metadata. It does not, however, state what happens if the upload succeeds but the visual match fails, or anything about rate limits or image size limits, so it falls short of the top mark.

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?

Despite covering 17 parameters, the layout is front-loaded and scannable with labeled sections, and the highest-value information (purpose, disambiguation, when-not-to-use) comes first. The parameter list mirrors the schema, which is somewhat redundant, but each line is short and none is 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?

For a 17-parameter tool with no output schema, the description supplies the return shape (products with in-stock sizes, pricing, and purchase URLs in the s.polopan.com/p/{handle} format) plus the temporary-storage lifetime model. Nothing an agent needs to invoke it correctly appears to be missing beyond edge-case error behavior.

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 coverage is 100%, so the baseline is 3, but the description adds one constraint the schema does not encode: exactly one of image_path or image_base64 is required, even though the schema lists zero required parameters. It also clarifies country accepts names, cities, currencies or ISO-2 codes and explains the global/local mode semantics, though it omits the image_url property that still exists in the schema, leaving an inconsistency an agent may need to resolve.

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 first sentence names a specific verb and resource ('Upload a local image file ... search PoloPan catalog products using visual image similarity') and the disambiguation block explicitly distinguishes it from products.search.image_url and vision.outfit.detect_pieces. An agent can identify and separate this tool from its siblings 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?

There are explicit WHEN TO USE and WHEN NOT TO USE sections, each naming the alternative that should be used instead (image_url for public URLs, products.search.text for text-only queries, vision.outfit.detect_pieces for outfit decomposition). The selection condition is stated directly rather than left for inference.

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.