Skip to main content
Glama

Vira – Create, Teach & Manage AI Behavior

cancel_task_run

Destructive

Cancel a scoped TaskRun using its current state version. Use only after the preceding resource and authority prerequisites are satisfied; inspect the server receipt before continuing. Required fields: organizationId, projectId, environmentId, taskRunId, expectedVersion. The authenticated MCP session supplies the tenant scope; any supplied scope identifiers must match it. Unknown fields are rejected. This changes governed state and remains fail-closed behind server authorization and an auditable receipt.

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": {
      "taskRunId": "<taskRunId>",
      "expectedVersion": "<expectedVersion>"
    },
    "name": "cancel_task_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
projectIdNoAuthenticated customer scope identifier; must match the API key scope and is never inferred from model text.
taskRunIdYesImmutable taskRunId reference used to bind this cancel_task_run operation to the correct released or persisted resource.
environmentIdNoAuthenticated customer scope identifier; must match the API key scope and is never inferred from model text.
organizationIdNoAuthenticated customer scope identifier; must match the API key scope and is never inferred from model text.
expectedVersionYesCurrent persisted lifecycle version; required for optimistic concurrency and must be read immediately before the transition.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / environmentId / description
      Added value: +"Authenticated customer scope identifier; must match the API key scope and is never inferred from model text."
    • addedInput schema / properties / expectedVersion / description
      Added value: +"Current persisted lifecycle version; required for optimistic concurrency and must be read immediately before the transition."
    • addedInput schema / properties / organizationId / description
      Added value: +"Authenticated customer scope identifier; must match the API key scope and is never inferred from model text."
    • addedInput schema / properties / projectId / description
      Added value: +"Authenticated customer scope identifier; must match the API key scope and is never inferred from model text."
    • addedInput schema / properties / taskRunId / description
      Added value: +"Immutable taskRunId reference used to bind this cancel_task_run operation to the correct released or persisted resource."
  2. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false, and readOnlyHint=false, so the safety profile is covered; the description still adds real value by disclosing optimistic-concurrency enforcement via expectedVersion, tenant-scope matching against the API key, rejection of unknown fields, and a fail-closed authorization plus auditable receipt. The 'changes governed state' statement is consistent with the destructive annotation. It stops short of saying what happens to in-flight work after cancellation or how failures surface.

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?

The purpose and the concurrency requirement are front-loaded, and each sentence carries distinct information about scope, validation, and authorization. Some phrasing is opaque filler for an agent ('inspect the server receipt before continuing') and the 'required fields' sentence duplicates schema content while getting it wrong.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, non-idempotent mutation with no output schema, the description covers the important constraints: concurrency version, tenant-scope enforcement, strict request validation, and fail-closed authorization with an auditable receipt. The main gap is that the referenced 'server receipt' return value is never characterized, so the agent cannot anticipate the response shape.

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%, so each parameter is already documented in the schema, making 3 the baseline. The description does add the semantic rule that supplied scope identifiers must match the authenticated session scope, but it also mislabels organizationId, projectId, and environmentId as 'Required fields' when the schema requires only taskRunId and expectedVersion, which can push an agent toward supplying unnecessary arguments.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 scoped TaskRun') plus the concurrency mechanism ('using its current state version'), which is clear enough for an agent to act on. It does not, however, distinguish itself from near-siblings such as resolve_task_run, retry_task_run, or continue_task_run, so the agent must infer why cancellation rather than resolution is correct.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Offers only a precondition ('Use only after the preceding resource and authority prerequisites are satisfied') that is self-referential and names no concrete prerequisite or alternative tool. There is no explicit guidance on when to cancel versus resolve, retry, or continue a TaskRun, leaving selection between siblings largely implied.

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