Skip to main content
Glama
metrxbots

Metrx MCP Server

by metrxbots

List Agents

metrx_list_agents
Read-onlyIdempotent

List all AI agents in your organization with status, category, and cost information. Filter results by status or category to identify available agents for operational tasks.

Instructions

List all AI agents in your organization with their status, category, and cost. Optionally filter by status or category. Returns agent IDs needed for other tools. Do NOT use for detailed per-agent analysis — use get_agent_detail for that.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoFilter by agent status
categoryNoFilter by agent category (e.g., "sales", "support", "engineering")

Implementation Reference

  • Main implementation of the list_agents tool. Registers the tool with name 'list_agents' (auto-prefixed to 'metrx_list_agents' by the server middleware), defines the input schema with optional status and category filters, and implements the handler logic that calls the /agents API endpoint and formats the results as a readable list of agents with their IDs, names, status, category, monthly costs, and ROI multipliers.
    server.registerTool(
      'list_agents',
      {
        title: 'List Agents',
        description:
          'List all AI agents in your organization with their status, category, and cost. ' +
          'Optionally filter by status or category. Returns agent IDs needed for other tools. ' +
          'Do NOT use for detailed per-agent analysis — use get_agent_detail for that.',
        inputSchema: {
          status: z
            .enum(['active', 'idle', 'error', 'archived'])
            .optional()
            .describe('Filter by agent status'),
          category: z
            .string()
            .optional()
            .describe('Filter by agent category (e.g., "sales", "support", "engineering")'),
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
      async ({ status, category }) => {
        const params: Record<string, string> = {};
        if (status) params.status = status;
        if (category) params.category = category;
    
        const result = await client.get<{ agents: AgentDetail[] }>('/agents', params);
    
        if (result.error) {
          return {
            content: [{ type: 'text', text: `Error listing agents: ${result.error}` }],
            isError: true,
          };
        }
    
        const agents = result.data?.agents || [];
        if (agents.length === 0) {
          return {
            content: [{ type: 'text', text: 'No agents found matching the specified filters.' }],
          };
        }
    
        const lines: string[] = [`## Agents (${agents.length})`, ''];
        for (const agent of agents) {
          const cost = agent.monthly_cost_cents ? formatCents(agent.monthly_cost_cents) : 'N/A';
          const roi = agent.roi_multiplier ? ` | ${agent.roi_multiplier.toFixed(1)}x ROI` : '';
          lines.push(
            `- **${agent.name}** [${agent.agent_key}] — ${agent.status} | ${agent.category} | ${cost}/mo${roi}`
          );
          lines.push(`  ID: ${agent.id}`);
        }
    
        return {
          content: [{ type: 'text', text: lines.join('\n') }],
        };
      }
    );
  • Input schema definition for list_agents tool using zod validation. Defines optional 'status' parameter (enum: active, idle, error, archived) and 'category' parameter (string) for filtering the agent list.
    inputSchema: {
      status: z
        .enum(['active', 'idle', 'error', 'archived'])
        .optional()
        .describe('Filter by agent status'),
      category: z
        .string()
        .optional()
        .describe('Filter by agent category (e.g., "sales", "support", "engineering")'),
    },
  • AgentDetail interface type definition used for the list_agents tool response. Extends AgentSummary with additional fields like description, framework_source, outcome_rung, primary_model, failure_risk_score, secondary_categories, and created_at.
    export interface AgentDetail extends AgentSummary {
      description?: string;
      parent_agent_id?: string;
      framework_source?: string;
      outcome_value_cents?: number;
      outcome_rung?: string;
      primary_model?: string;
      failure_risk_score?: number;
      secondary_categories?: string[];
      created_at: string;
    }
  • The registerDashboardTools function exports the registration logic that is called from src/index.ts line 106. This function registers all dashboard-related tools including list_agents with the MCP server.
    export function registerDashboardTools(server: McpServer, client: MetrxApiClient): void {
  • The formatCents helper function used by list_agents handler to convert monthly_cost_cents values to dollar string format for display in the agent list output.
    export function formatCents(cents: number): string {
      return `$${(cents / 100).toFixed(2)}`;
    }
Behavior4/5

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

The description adds valuable context beyond annotations: it explains the return value ('Returns agent IDs needed for other tools') and clarifies the tool's role in the workflow. Annotations already cover safety (readOnlyHint=true, destructiveHint=false) and idempotency, so the bar is lower, but the description enhances understanding without contradicting annotations.

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 front-loaded with the core purpose, followed by optional filtering and usage guidance. Every sentence earns its place: the first defines the tool, the second adds filtering context, and the third provides critical usage boundaries. It's efficient with zero waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (list operation), rich annotations (covering safety and idempotency), and 100% schema coverage, the description is mostly complete. It lacks output schema details (e.g., format of returned data), but this is mitigated by annotations and clear purpose. A minor gap in output specifics prevents a perfect score.

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%, with both parameters ('status' and 'category') well-documented in the schema. The description mentions filtering by status or category but adds no additional syntax or format details beyond what the schema provides. Baseline 3 is appropriate when 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 specific action ('List all AI agents'), resource ('in your organization'), and scope ('with their status, category, and cost'), distinguishing it from sibling tools like 'metrx_get_agent_detail' for detailed analysis. It provides a comprehensive overview of what the tool does beyond just the name/title.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('List all AI agents... Returns agent IDs needed for other tools') and when not to use it ('Do NOT use for detailed per-agent analysis — use get_agent_detail for that'), naming the alternative tool. This provides clear guidance on usage versus alternatives.

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/metrxbots/metrx-mcp-server'

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