Skip to main content
Glama

twining_handoff

Transfer work between agents by creating handoff records that capture results, assemble context snapshots, and post status updates to the shared blackboard.

Instructions

Create a handoff record from one agent to another, capturing work results and auto-assembling context snapshot. Posts a status entry to the blackboard.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_agentYesID of the agent handing off work
target_agentNoID of the target agent (omit for open handoff to any agent)
scopeNoScope of the handoff (default: 'project')
summaryYesSummary of work being handed off
resultsYesResults of the work being handed off
auto_snapshotNoAuto-assemble context snapshot from decisions/warnings (default: true)

Implementation Reference

  • The 'twining_handoff' tool handler logic in src/tools/coordination-tools.ts, which uses coordinationEngine.createHandoff and optionally graphPopulator.onHandoff.
    // twining_handoff — Create a handoff between agents
    server.registerTool(
      "twining_handoff",
      {
        description:
          "Create a handoff record from one agent to another, capturing work results and auto-assembling context snapshot. Posts a status entry to the blackboard.",
        inputSchema: {
          source_agent: z
            .string()
            .describe("ID of the agent handing off work"),
          target_agent: z
            .string()
            .optional()
            .describe("ID of the target agent (omit for open handoff to any agent)"),
          scope: z
            .string()
            .optional()
            .describe("Scope of the handoff (default: 'project')"),
          summary: z
            .string()
            .describe("Summary of work being handed off"),
          results: z
            .array(
              z.object({
                description: z.string().describe("What was done"),
                status: z
                  .enum(["completed", "partial", "blocked", "failed"])
                  .describe("Result status"),
                artifacts: z
                  .array(z.string())
                  .optional()
                  .describe("File paths or artifact IDs produced"),
                notes: z
                  .string()
                  .optional()
                  .describe("Additional notes"),
              }),
            )
            .describe("Results of the work being handed off"),
          auto_snapshot: z
            .boolean()
            .optional()
            .describe("Auto-assemble context snapshot from decisions/warnings (default: true)"),
        },
      },
      async (args) => {
        try {
          const record = await coordinationEngine.createHandoff({
            source_agent: args.source_agent,
            target_agent: args.target_agent,
            scope: args.scope,
            summary: args.summary,
            results: args.results,
            auto_snapshot: args.auto_snapshot,
          });
          // Auto-populate graph with handoff entities/relations
          if (graphPopulator) {
            await graphPopulator.onHandoff({
              source_agent: args.source_agent,
              target_agent: args.target_agent,
              scope: args.scope,
              results: args.results,
            });
          }
          return toolResult({
            id: record.id,
            created_at: record.created_at,
            source_agent: record.source_agent,
            target_agent: record.target_agent,
            scope: record.scope,
            summary: record.summary,
            result_count: record.results.length,
            context_snapshot_size: {
              decisions: record.context_snapshot.decision_ids.length,
              warnings: record.context_snapshot.warning_ids.length,
              findings: record.context_snapshot.finding_ids.length,
            },
          });
        } catch (e) {
          return toolError(
            e instanceof Error ? e.message : "Unknown error",
            "INTERNAL_ERROR",
          );
        }
      },
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden. It mentions behavioral aspects like 'auto-assembling context snapshot' and 'Posts a status entry to the blackboard', but doesn't disclose critical traits such as permissions needed, whether the operation is idempotent, rate limits, or what happens if the target_agent is omitted. It's insufficient for a mutation tool with zero annotation coverage.

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 a single, efficient sentence that front-loads the core action ('Create a handoff record') and includes key details without waste. However, it could be slightly more structured by separating the main action from secondary effects for clarity.

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?

Given the tool's complexity (6 parameters, mutation operation, no output schema, and no annotations), the description is moderately complete. It covers the purpose and some behavior but lacks details on return values, error handling, or integration with sibling tools, leaving gaps for an AI agent to use it correctly.

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 the schema already documents all parameters thoroughly. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't explain the 'blackboard' reference or provide examples for 'results' array). Baseline 3 is appropriate as the schema does the heavy lifting.

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 the tool's purpose with specific verbs ('Create a handoff record', 'capturing work results', 'auto-assembling context snapshot', 'Posts a status entry') and distinguishes it from siblings like 'twining_acknowledge' or 'twining_post' by focusing on agent-to-agent handoffs with context preservation. It's not a tautology of the name.

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?

The description implies usage for transferring work between agents with context, but doesn't explicitly state when to use this vs. alternatives like 'twining_delegate' or 'twining_post'. It provides some context (e.g., 'auto-assembling context snapshot') but lacks explicit guidance on prerequisites or exclusions.

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/daveangulo/twining-mcp'

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