Skip to main content
Glama

Run Supplier Autofix

sirv_run_supplier_autofix

Fixes a supplier image with AI so it meets your workspace submission rules using failed rules or a prompt. Returns the fixed image URL, fix status, and fixes applied.

Instructions

Fix one supplier image with AI so that it meets the workspace's submission rules.

Use auto mode with the rules the image failed in failed_rules, or prompt mode with an instruction in prompt. Read the rules first with sirv_get_supplier_portal_settings. For one plain edit, such as a background removal, use that tool instead.

It runs up to max_iterations rounds of fixes, such as upscale, background removal, smart crop and AI edits. The source image does not change. Returns the fixed image URL, whether it was fixed, and the fixes that ran.

Credits: spends workspace credits. The cost depends on the fixes that run.

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": {
      "image_url": "<image_url>"
    },
    "name": "sirv_run_supplier_autofix"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoauto: fix the rules in failed_rules. prompt: follow the instruction in prompt. Default: autoauto
orgIdNoWorkspace id from sirv_list_organizations. Default: the workspace you signed in to
promptNoFor prompt mode: what to fix, in words
ai_modelNoModel that plans the fixes. Default: gemini-2-flashgemini-2-flash
image_urlYesPublic URL of the supplier image to fix
failed_rulesNoFor auto mode: the rules the image failed, as the review returned them
enabled_fixesNoThe kinds of fix the tool may use. Default: all of them
upscale_modelNoUpscaler for an upscale fix. Default: esrganesrgan
max_iterationsNoMost fix rounds to run, 1 to 5. Default: 3

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed21 schema fields changedv0.1.1
    • addedInput schema / properties / ai_model / description
      Added value: +"Model that plans the fixes. Default: gemini-2-flash"
    • removedInput schema / properties / enabled_fixes / additionalProperties
      Removed value: -false
    • addedInput schema / properties / enabled_fixes / description
      Added value: +"The kinds of fix the tool may use. Default: all of them"
    • addedInput schema / properties / enabled_fixes / properties / image_to_image / description
      Added value: +"Allow AI image edits. Default: true"
    • addedInput schema / properties / enabled_fixes / properties / remove_background / description
      Added value: +"Allow background removal. Default: true"
    • addedInput schema / properties / enabled_fixes / properties / smart_crop / description
      Added value: +"Allow smart cropping. Default: true"
    • addedInput schema / properties / enabled_fixes / properties / upscale / description
      Added value: +"Allow upscaling. Default: true"
    • changedInput schema / properties / failed_rules / description
      Previous value: -"Failed review rules to guide auto-mode repairs"New value: +"For auto mode: the rules the image failed, as the review returned them"
    • addedInput schema / properties / failed_rules / items / properties / details / description
      Added value: +"The rule's own details, such as minWidth"
    • addedInput schema / properties / failed_rules / items / properties / details / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / failed_rules / items / properties / message / description
      Added value: +"What failed, in words"
    • addedInput schema / properties / failed_rules / items / properties / passed / description
      Added value: +"false for a failed rule"
    • addedInput schema / properties / failed_rules / items / properties / ruleId / description
      Added value: +"The rule's id"
    • addedInput schema / properties / failed_rules / items / properties / ruleType / description
      Added value: +"The rule's type, such as min_dimension"
    • changedInput schema / properties / image_url / description
      Previous value: -"URL of the supplier image to autofix"New value: +"Public URL of the supplier image to fix"
    • changedInput schema / properties / max_iterations / description
      Previous value: -"Maximum autofix iterations"New value: +"Most fix rounds to run, 1 to 5. Default: 3"
    • changedInput schema / properties / mode / description
      Previous value: -"Autofix mode"New value: +"auto: fix the rules in failed_rules. prompt: follow the instruction in prompt. Default: auto"
    • changedInput schema / properties / orgId / description
      Previous value: -"Organization ID (uses default org if omitted)"New value: +"Workspace id from sirv_list_organizations. Default: the workspace you signed in to"
    • addedInput schema / properties / orgId / pattern
      Added value: +"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    • changedInput schema / properties / prompt / description
      Previous value: -"Prompt to guide prompt-mode repairs"New value: +"For prompt mode: what to fix, in words"
    • addedInput schema / properties / upscale_model / description
      Added value: +"Upscaler for an upscale fix. Default: esrgan"
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly=false, openWorld=true and destructive=false, so the description's main added duty is mutation scope and cost. It delivers both: 'The source image does not change' clarifies that the mutation is non-destructive to the original, and the Credits paragraph warns that workspace credits are spent at a cost that varies with the fixes run. Return contents are also previewed. It stops short of failure behavior or what happens on partial iteration success.

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

Conciseness4/5

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

Four short paragraphs, front-loaded with the core action, then the mode branch, then mechanics, then cost. Nearly every sentence earns its place; only the credits note slightly restates the generic 'spends credits' notion, but it adds the variable-cost detail, so it is justified.

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?

Nine parameters, nested rule objects and three enums make this a complex tool, and there is no output schema to explain results. The description compensates by naming what is returned ('the fixed image URL, whether it was fixed, and the fixes that ran') and by explaining the iteration ceiling and available fix types, leaving nothing essential unstated for correct invocation.

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 and the schema already documents every property including defaults and enums. The description still adds value by surfacing the cross-parameter constraint that auto mode depends on failed_rules and prompt mode depends on prompt, plus the coupling of max_iterations to iterative fix rounds — relationships the flat schema cannot express.

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 a specific verb+resource+scope: 'Fix one supplier image with AI so that it meets the workspace's submission rules.' It also explicitly contrasts itself with the plain-edit tool ('For one plain edit, such as a background removal, use that tool instead'), so an agent can separate it from sirv_edit_image without opening either 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?

Gives explicit branch conditions: auto mode consumes failed_rules, prompt mode consumes prompt. It names a prerequisite ('Read the rules first with sirv_get_supplier_portal_settings') and an exclusion routing to a different tool for simple edits. This is the strongest possible form of when/when-not/alternatives guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.