Skip to main content
Glama

Cancel a pending job

cancel_job
DestructiveIdempotent

Cancel a job still waiting for payment.

Free to call, no authentication. Only pending_payment jobs can be cancelled; a paid, done, failed, or refunded job is untouched and the response says why.

Behavior: marks the job cancelled. No funds move - no payment was taken. Cancelling twice is safe.

Parameters: an unknown key returns found=false.

When to use: when a job is stuck unpaid. For a paid job use refund_job.

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": {
      "job_key": "<job_key>"
    },
    "name": "cancel_job"
  }
}

Input Schema

NameRequiredDescriptionDefault
job_keyYesJob key to cancel, from execute_task or list_jobs. Required.

Output Schema

NameRequiredDescriptionDefault
foundYesfalse when no job exists with that key
reasonNo
job_keyNo
cancelledYestrue when the job was still pending_payment

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: it clarifies that destructiveHint actually means only a status mark with no funds moving, that no payment was taken, that cancelling twice is safe, and that an out-of-state job returns a response explaining why. It also discloses the operational profile (free, no auth), which no annotation covers.

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?

Purpose is front-loaded and the labeled sections (Behavior, Parameters, When to use) make it scannable with no filler sentences. The 'Parameters' label is slightly misused since that line actually describes a return value, and the hard line wraps fragment sentences.

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, the description covers everything an agent needs: precondition, state change, safety on retry, and failure signalling. The only return detail it gives ('the response says why') is a helpful pointer, not a substitute for 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% with a single well-documented job_key, so the baseline is 3. The description adds only one behavioral note — an unknown key returns found=false rather than erroring — which is useful for handling bad input but is more output behavior than parameter semantics.

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 with an explicit scope: 'Cancel a job still waiting for payment.' The scope word 'pending_payment' distinguishes it immediately from refund_job, so an agent can route 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 a positive trigger ('when a job is stuck unpaid'), an exclusion ('a paid, done, failed, or refunded job is untouched'), and names the correct sibling for the other case ('For a paid job use `refund_job`'). Nothing about selection is left to 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.

Resources