twining_agents
View all active agents with their capabilities and status to coordinate development tasks through a shared blackboard and knowledge graph.
Instructions
List all registered agents with their capabilities and liveness status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_gone | No | Whether to include gone agents (default: true) |
Implementation Reference
- src/tools/coordination-tools.ts:40-77 (handler)The handler for the 'twining_agents' tool, which fetches all registered agents and computes their liveness status.
async (args) => { try { const includeGone = args.include_gone ?? true; const agents = await agentStore.getAll(); const thresholds = config.agents?.liveness ?? DEFAULT_LIVENESS_THRESHOLDS; const now = new Date(); const mapped = agents.map((agent) => ({ agent_id: agent.agent_id, capabilities: agent.capabilities, role: agent.role, description: agent.description, registered_at: agent.registered_at, last_active: agent.last_active, liveness: computeLiveness(agent.last_active, now, thresholds), })); const filtered = includeGone ? mapped : mapped.filter((a) => a.liveness !== "gone"); const activeCount = mapped.filter( (a) => a.liveness === "active", ).length; return toolResult({ agents: filtered, total_registered: agents.length, active_count: activeCount, }); } catch (e) { return toolError( e instanceof Error ? e.message : "Unknown error", "INTERNAL_ERROR", ); } }, - Input schema for 'twining_agents' tool, defining the optional 'include_gone' boolean parameter.
inputSchema: { include_gone: z .boolean() .optional() .describe( "Whether to include gone agents (default: true)", ), }, - src/tools/coordination-tools.ts:26-78 (registration)Registration of the 'twining_agents' tool within the registerCoordinationTools function.
server.registerTool( "twining_agents", { description: "List all registered agents with their capabilities and liveness status.", inputSchema: { include_gone: z .boolean() .optional() .describe( "Whether to include gone agents (default: true)", ), }, }, async (args) => { try { const includeGone = args.include_gone ?? true; const agents = await agentStore.getAll(); const thresholds = config.agents?.liveness ?? DEFAULT_LIVENESS_THRESHOLDS; const now = new Date(); const mapped = agents.map((agent) => ({ agent_id: agent.agent_id, capabilities: agent.capabilities, role: agent.role, description: agent.description, registered_at: agent.registered_at, last_active: agent.last_active, liveness: computeLiveness(agent.last_active, now, thresholds), })); const filtered = includeGone ? mapped : mapped.filter((a) => a.liveness !== "gone"); const activeCount = mapped.filter( (a) => a.liveness === "active", ).length; return toolResult({ agents: filtered, total_registered: agents.length, active_count: activeCount, }); } catch (e) { return toolError( e instanceof Error ? e.message : "Unknown error", "INTERNAL_ERROR", ); } }, );