Skip to main content
Glama

orchestrator_transition_task

Transition A2A tasks through the official 8-state v1.0.1 FSM with atomic expected_version compare-and-swap locking to reject invalid terminal-state changes and prevent TOCTOU resurrection bugs.

Instructions

Enforce the official 8-state A2A v1.0.1 Task Finite State Machine (TASK_STATE_SUBMITTED, TASK_STATE_WORKING, TASK_STATE_INPUT_REQUIRED, TASK_STATE_AUTH_REQUIRED, TASK_STATE_COMPLETED, TASK_STATE_FAILED, TASK_STATE_CANCELED, TASK_STATE_REJECTED) using atomic optimistic expected_version Compare-And-Swap (CAS) locking — deterministically rejecting transitions out of terminal states to eliminate TOCTOU resurrection bugs.

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": {
      "tenant_id": "<tenant_id>",
      "task_id": "<task_id>",
      "target_state": "<target_state>",
      "expected_version": "<expected_version>"
    },
    "name": "orchestrator_transition_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
actorNoAgent or worker identity recording this transition.orchestrator
reasonNoAudit log reason or A2A status update text (DLP-scrubbed).
task_idYesTarget A2A `Task.id`.
tenant_idYesTenant namespace owning the task (`SPEC_CLASS_13`).
target_stateYesNext A2A `v1.0.1` `TaskState` enum value.
expected_versionYesCurrent optimistic lock `version` required for Compare-And-Swap (`CAS`) success.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations only declare non-read-only, non-destructive, non-idempotent, closed-world; the description adds substantive behavior beyond that — atomic CAS via expected_version and hard rejection of terminal-state transitions, which is exactly the failure mode an agent needs to anticipate. It stops short of describing what a version-mismatch rejection looks like (error shape, retry posture) or whether a transition emits audit events, so it is not fully transparent.

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?

One front-loaded sentence that leads with the enforcement guarantee and mechanism, with zero filler. It is dense with parenthetical state lists and backticked identifiers, which slightly hurts scannability but every clause carries information.

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

Completeness3/5

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

This is a mutation tool with four required parameters and no output schema, so the description must carry the return/error burden — but it says nothing about what a successful transition returns or how a CAS conflict surfaces. State-space and locking semantics are well covered; the response contract and permission requirements are not.

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%, and the schema already explains expected_version as the CAS lock and target_state as the A2A enum. The description reinforces the CAS intent of expected_version but adds no syntax, constraint, or interaction detail beyond the schema; the baseline 3 applies.

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?

The description names a specific mechanism ('atomic optimistic expected_version Compare-And-Swap') and resource (the A2A v1.0.1 8-state Task FSM), enumerating all eight states so the agent knows exactly what domain it operates in. The plain-language action ('move a task to a new state') is only implied through the FSM/CAS framing, so an agent without A2A vocabulary must decode jargon, but the underlying purpose is unambiguous.

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?

Usage is implied rather than stated: the tool is for legitimate state advancement, and 'deterministically rejecting transitions out of terminal states' tells the agent a class of calls that will fail. There is no explicit when-to-use versus siblings (e.g. orchestrator_create_task for creating, orchestrator_inspect_task_lineage for reading), and no prerequisite or workflow guidance.

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