Skip to main content
Glama

list_agents

Retrieve and filter all AI agents managed by the terminal multiplexer server, enabling monitoring by state, repository, or model.

Instructions

List all agents with optional filters by state, repo, or model.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateNoFilter by state
repoNoFilter by repository
modelNoFilter by model

Implementation Reference

  • The handler function for the list_agents tool, which calls engine.listAgents.
    async (args) => {
      try {
        const agents = engine.listAgents({
          state: args.state,
          repo: args.repo,
          model: args.model,
        });
        return ok({
          agents: agents as unknown as Record<string, unknown>[],
          count: agents.length,
        });
      } catch (e) {
        return err(e);
      }
    },
  • src/server.ts:797-816 (registration)
    Registration of the list_agents tool including its schema definition.
    // 15. list_agents
    server.tool(
      "list_agents",
      "List all agents with optional filters by state, repo, or model.",
      {
        state: z
          .enum([
            "creating",
            "booting",
            "ready",
            "working",
            "idle",
            "done",
            "error",
          ])
          .optional()
          .describe("Filter by state"),
        repo: z.string().optional().describe("Filter by repository"),
        model: z.string().optional().describe("Filter by model"),
      },
  • The implementation of listAgents in the engine, which delegates to the registry.
    /**
     * List agents with optional filters.
     */
    listAgents(filter?: AgentFilter): AgentRecord[] {
      return this.registry.list(filter);
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It doesn't mention whether this is a read-only operation, if it requires authentication, potential rate limits, pagination behavior, or what format the returned list takes. 'List all agents' implies a read operation but lacks crucial details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core functionality and filtering options without any wasted words. It's appropriately sized for this straightforward list operation.

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?

For a list operation with no annotations and no output schema, the description is minimally adequate but leaves significant gaps. It doesn't explain what information is returned about each agent, whether results are paginated, or any authentication requirements. The 100% schema coverage helps, but more behavioral context would be beneficial.

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 three parameters with their types and the state enum values. The description adds marginal value by mentioning the three filter types but doesn't provide additional semantic context beyond what's in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('all agents'), and specifies optional filtering capabilities. However, it doesn't explicitly differentiate from sibling tools like 'get_agent_state' or 'spawn_agent', which prevents a perfect score.

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

Usage Guidelines2/5

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

No guidance is provided about when to use this tool versus alternatives like 'get_agent_state' for single-agent queries or 'spawn_agent' for creation. The description only states what the tool does, not when it's appropriate.

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/EtanHey/cmuxlayer'

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