Skip to main content
Glama

Cancel a restoration

pinin_cancel_restoration

Cancels a queued photo restoration before processing starts, so no credit is charged or refunded. Fails with too_late_to_cancel once the pipeline has already picked up the job.

Instructions

Cancel a restoration that has not started processing. A queued job has not been charged, so cancelling costs nothing and refunds nothing; once the pipeline has picked it up the call fails with too_late_to_cancel and the credit stands. Check pinin_get_restoration first when the state is unknown. Writes job state — with pinin_restore_photo it is the only tool that changes anything.

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": {
      "id": "<id>"
    },
    "name": "pinin_cancel_restoration"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesRestoration id to cancel — the `id` field from pinin_restore_photo or pinin_list_restorations.

Output Schema

NameRequiredDescriptionDefault
idNoRestoration id.
errorNo`{ code, message }`, for example `too_late_to_cancel`.
objectNoAlways `restoration`.
statusNo`cancelled` on success.
creditsNoCredits charged — zero for a job cancelled while queued.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, destructiveHint=false, openWorldHint=true) by disclosing the billing semantics — a queued job is neither charged nor refunded, and once picked up the credit stands — plus the concrete error code. It also flags that this mutates job state and is one of only two mutating tools, which is exactly the context the annotations cannot express.

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?

Three tight sentences, front-loaded with the scope constraint, then cost semantics, then the precheck advice. No redundant restatement of the title or schema.

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 one-parameter mutation with an output schema and annotations already present, nothing an agent needs is missing: scope, cost, error mode, and the recommended companion read tool are all stated. Return-value detail is correctly left to the output schema.

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 coverage is 100% and the single `id` parameter is fully documented in the schema, so the description adds no parameter-level detail. Baseline 3 is appropriate when the schema carries the full weight.

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 and resource ('Cancel a restoration') plus the exact scope condition ('that has not started processing'), which is the discriminator an agent needs. It is immediately distinguishable from the read-only siblings like pinin_get_restoration and pinin_list_restorations.

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 an explicit prerequisite ('Check pinin_get_restoration first when the state is unknown') and names the failure condition ('once the pipeline has picked it up the call fails with `too_late_to_cancel`'). The agent knows both when to call it and when the call is pointless.

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