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",
          );
        }
      },
    );

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