Skip to main content
Glama

Restore a photograph

pinin_restore_photo

Queue one or up to 100 photographs for damage repair, colorization, deblurring or upscaling, then read results with pinin_get_restoration. Use dry_run to price without spending credits.

Instructions

Queue photographs for restoration — damage repair, colorization, deblurring, upscaling — on the account behind the key. Send one photo as a public https image_url (preferred) or as image_base64, or up to 100 with images. Costs one credit per image, charged when the job settles and refunded automatically if it fails. Returns the new job in pending and does not wait: read the result with pinin_get_restoration. Pass idempotency_key when a retry must not charge twice, and dry_run: true to price a request without spending. Not for reading, listing or cancelling existing jobs — those are pinin_get_restoration, pinin_list_restorations and pinin_cancel_restoration.

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": "pinin_restore_photo"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoWhat to do to the photo. `all-in-one` (default) repairs damage and improves the image in one pass; `dust-scratch` removes specks and scratches only; `colorize` adds colour to black-and-white photos; `deblur-upscale` fixes soft focus and enlarges; `upscale-only` enlarges without other changes. Call pinin_list_modes for the cost of each.
seedNoDeterministic output: the same seed with the same image and mode gives the same result. Omit for a fresh variation.
imagesNoBatch of up to 100 photographs, each a public https URL string or an object with `image_url`. Use this instead of `image_url` for more than one photo; `images` wins if both are given.
dry_runNoPrice the request without spending credits or queueing anything. The answer is a `dry_run` object with `credits_required`, `credits_balance` and `valid` instead of a restoration.
metadataNoYour own JSON object, max 2 KB. Stored on the job, returned by pinin_get_restoration and echoed in webhook payloads — use it to carry your own identifier.
image_urlNoPublic https URL of one photograph. Any image format; the URL must be reachable by Pinin, not a private or localhost address.
mime_typeNoContent type of `image_base64`, for example `image/jpeg` or `image/png`. Ignored when the input is a URL.
image_base64NoInline image as base64 or a data URL. Single image only, and only when the photo cannot be hosted: prefer `image_url` for anything over a few megabytes.
idempotency_keyNo8–128 printable ASCII characters. A repeat with the same key returns the jobs the first call created instead of queueing and charging again.

Output Schema

NameRequiredDescriptionDefault
idNoRestoration id — pass it to pinin_get_restoration, pinin_download_restoration or pinin_cancel_restoration.
modeNoThe restoration mode the job was queued with.
seedNoThe deterministic seed in force, or null when unset.
errorNoFailure detail ({ code, message }) when status is `failed`, otherwise null.
validNoWhether the request would be accepted (dry_run only).
imagesNoSigned URLs (`original`, `restored`), each `{ url, expires_in }` in seconds — null until the job completes.
objectNo`restoration`, or `dry_run` when `dry_run` was true.
statusNo`pending` on creation; progresses to `processing`, `completed` or `failed`.
creditsNoCredits this job will charge, or charged if it already settled.
metadataNoThe metadata object supplied at creation.
share_urlNoPublic share link for the restored photo, or null before completion.
created_atNoISO 8601 creation instant.
expires_atNoISO 8601 instant when the input and output files are deleted.
updated_atNoISO 8601 instant of the last state change.
completed_atNoISO 8601 completion instant, or null while running.
order_numberNoHuman-readable order reference for support.
credits_balanceNoBalance at the time of pricing (dry_run only).
credits_requiredNoCredits the request would cost (dry_run only).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare write/open-world/non-destructive, but the description adds the crucial economics and lifecycle: one credit per image, charged at settlement, auto-refunded on failure, and a job returned in `pending` without waiting. That is exactly the behavior an agent needs before spending credits.

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?

Front-loads purpose, then inputs, cost model, async return, and finally exclusions — a logical order with no filler. It is somewhat dense and long, but nearly every clause carries operational information.

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 9-parameter, nested-object, async, credit-spending tool, it covers the essentials: input shapes, cost and refund behavior, non-blocking return, and where to read the result. An output schema exists, so the description need not spell out response fields.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is already 100%, so the schema documents modes, seeds, URLs, base64, metadata, and idempotency in detail. The description restates the URL-vs-base64 preference and batch precedence but adds little parameter meaning beyond what the schema already provides, so the baseline 3 applies.

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?

Opens with a specific verb and resource ('Queue photographs for restoration') and immediately enumerates the operation modes. It also explicitly names the three siblings it is not for, so an agent can separate it from read/list/cancel tools without opening a 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 routing rules: use pinin_get_restoration to read results, and the other named siblings for listing and cancelling. It also states when to prefer image_url over image_base64, when to use images for batches, and when to reach for dry_run or idempotency_key.

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