Skip to main content
Glama

Pipeline Handoff (Inter-Agent State)

pipeline_handoff

Write and read structured data across pipeline phases to coordinate multi-step workflows.

Instructions

Structured inter-agent communication for pipeline workflows.

USE WHEN: Orchestrators need to exchange structured data between pipeline phases. Each phase writes its output; the next phase reads it. All data persists in .cortex/.session/{id}/{pipeline}/.

WORKFLOW (simplified):

  1. pipeline_handoff(operation="init", pipeline="commit")

  2. pipeline_handoff(operation="write", pipeline="commit", phase="preflight", data='{"status":"complete","snapshot_ref":"abc123"}')

  3. pipeline_handoff(operation="read", pipeline="commit", phase="preflight") → reads phase data

  4. pipeline_handoff(operation="read", pipeline="commit") → reads full pipeline state (all phases)

  5. pipeline_handoff(operation="clear", pipeline="commit")

EXAMPLES:

  • pipeline_handoff(operation="init", pipeline="commit")

  • pipeline_handoff(operation="write", pipeline="commit", phase="checks", data='{"status":"passed","coverage":0.94}')

  • pipeline_handoff(operation="read", pipeline="commit", phase="checks")

  • pipeline_handoff(operation="read", pipeline="commit")

  • pipeline_handoff(operation="clear", pipeline="commit")

Legacy aliases (write_task, read_task, write_result, read_state) still work.

RETURNS: JSON with {status, ...} for write ops; JSON file content for reads.

Args: operation: init | write | read | read_log | status | mark_running | clear | snapshot | rollback (legacy: write_task, read_task, write_result, read_state) pipeline: Pipeline name (e.g. "commit", "implement"). Default: "default". phase: Phase name (e.g. "preflight", "checks"). Required for write. For read: if given, reads that phase; if omitted, reads full state. data: Payload for write and init. Accepts JSON string or native object. When the JSON includes free-text fields such as context or summary, write compact technical prose (see cortex://rules, Agent-Internal Communication): no filler or hedging; keep file paths and error messages verbatim. paths: Paths to snapshot for operation="snapshot". Can be passed via this argument or via data={"paths":[...]} for arg-stripping clients. snapshot_id: Snapshot id for operation="rollback". Can be passed via this argument or via data={"snapshot_id":"..."}. ctx: MCP context (auto-provided).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
pathsNo
phaseNo
pipelineNodefault
operationNoread_state
snapshot_idNo
Behavior4/5

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

Annotations indicate read/write operations. The description adds that data persists in '.cortex/.session/{id}/{pipeline}/,' describes effects of each operation (write, clear, snapshot, rollback), and mentions legacy aliases. This goes beyond the annotations' binary hints.

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 description is well-structured with sections (overview, USE WHEN, WORKFLOW, EXAMPLES, RETURNS, Args). While lengthy, each section adds distinct value. Minor redundancy between workflow and examples, but overall efficient.

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?

Given the tool's complexity (6 parameters, no output schema), the description covers purpose, usage, parameters, return types, and behavioral details (persistence, effects). It is sufficiently complete for an agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema coverage, the description fully documents all 6 parameters: operation lists possible values, pipeline defaults, phase required/optional constraints, data accepts JSON, paths and snapshot_id for snapshot/rollback, and ctx auto-provided. This compensates fully for the schema gap.

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 clearly states it is for 'structured inter-agent communication for pipeline workflows,' uses specific verbs (handoff, init, write, read, clear), and distinguishes from siblings by focusing on pipeline state exchange.

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

Usage Guidelines4/5

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

The 'USE WHEN' section explicitly says 'Orchestrators need to exchange structured data between pipeline phases.' It provides a workflow and examples, though it does not explicitly mention when not to use or alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/igrechuhin/Cortex'

If you have feedback or need assistance with the MCP directory API, please join our Discord server