Skip to main content
Glama

cancel_job

Destructive

Cancel a job that is STILL QUEUED. Free, repeatable, never refunds.

    ALWAYS branch on `cancelled`; reason + next_action say what to do. A queued job
    was never charged (the worker charges), so credits_refunded is always 0. A RUNNING
    job cannot be stopped: it finishes, CHARGES and persists. Cancelled reads as
    status "failed" with error.error.details.cancelled true; to re-run, resubmit with
    a FRESH idempotency_key (reusing the cancelled one replays the cancelled result).
    Errors: unauthorized, forbidden (key lacks the spend scope), not_found, rate_limited.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesThe job to cancel. Account-scoped: an id you do not own reads as not_found, exactly like get_job.
api_keyNoAPI key for this call. Omit to fall back to the Authorization: Bearer / X-API-Key request header (streamable-HTTP only), then the VHGENGINE_API_KEY env var (the stdio default). No key resolvable -> unauthorized.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoNot returned by this tool. Named here because get_job(job_id) afterwards carries error.error.details.cancelled true (code 'conflict', details.reason 'cancelled'): THAT is how you tell your own cancel apart from a genuine job failure.
job_idNoThe job the cancel targeted.
reasonNoWhy the call ended the way it did, in one sentence.
statusNoThe job's status AFTER the attempt: 'failed' when cancelled, else whatever it really is (running / succeeded / failed).
cancelledNotrue only when this call moved a still-QUEUED job to terminal. false means nothing changed; `reason` says why and `next_action` says what to do.
next_actionNoThe exact next call to make, if any.
credits_refundedNoAlways 0. A queued job was never charged (the charge runs inside the worker), and a running job cannot be stopped, so a cancel never refunds.
already_cancelledNotrue when an earlier cancel_job had already cancelled this job, so this call was a no-op rather than a miss.

TDQS

A4.7/5.0
Behavior5/5

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

Goes far beyond the destructiveHint=true annotation. Discloses non-refundable behavior ('never refunds'), the absence of refunds for queued jobs ('credits_refunded is always 0'), post-cancellation status ('reads as status \"failed\"'), and the idempotency quirk ('reusing the cancelled one replays the cancelled result'). Also enumerates error conditions: unauthorized, forbidden, not_found, rate_limited.

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?

The description is compact yet information-dense. Front-loaded with the primary action, each sentence adds critical operational detail (status handling, refunds, errors, idempotency). No filler or repetition.

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?

Despite having full schema coverage and an output schema, the description adds necessary behavioral context: what counts as cancellation, why refunds are always 0, how cancelled results appear, and how to handle errors. This is more than sufficient for an agent to safely invoke the tool.

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 100%, so baseline is 3. The tool description does not add parameter-specific semantics beyond what the schema already provides (e.g., job_id's account-scoping and api_key's fallback chain). The description's idempotency_key note is about a different call, not this tool's parameters.

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 description opens with 'Cancel a job that is STILL QUEUED,' which states the exact verb, resource, and condition. It clearly distinguishes from sibling tools like get_job, list_jobs, start_generate_job, and wait_for_job by narrowing the scope to queued jobs only.

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?

Explicitly states when to use: 'Cancel a job that is STILL QUEUED.' Provides a when-not: 'A RUNNING job cannot be stopped: it finishes, CHARGES and persists.' Offers an alternative for re-running: 'resubmit with a FRESH idempotency_key.' It also directs the caller to branch on 'cancelled' and use 'reason + next_action.'

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.

TDQS

A4.1/5.0
Disambiguation5/5

Each tool targets a distinct resource and action, e.g., signup vs. delete_account, create_key vs. revoke_key, generate_hooks vs. score_hook. Even similar tools like generate_hooks and generate_hooks_batch are clearly differentiated by single vs. batch operation.

Naming Consistency5/5

All 32 tools use a consistent verb_noun snake_case pattern (e.g., add_credits, create_checkout, revoke_key, list_outcomes) with no mixing of camelCase or other conventions.

Tool Count4/5

32 tools is slightly above the typical 15-tool range, but the domain is broad (account, keys, webhooks, generation, scoring, jobs, outcomes), and each tool has a specific purpose. No tools seem redundant.

Completeness4/5

The tool surface covers most lifecycle operations: CRUD for accounts/keys/webhooks, generation/scoring with batch and async variants, outcomes reporting, and auxiliary tools. Missing explicit delete for hooks (expire automatically) and some update operations, but no critical gaps.

Resources