Skip to main content
Glama

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
NameRequiredDescriptionDefault
include_goneNoWhether to include gone agents (default: true)

Implementation Reference

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

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