Skip to main content
Glama
metrxbots

Metrx MCP Server

by metrxbots

Get Agent Detail

metrx_get_agent_detail
Read-onlyIdempotent

Retrieve detailed information about a specific agent, including its model, framework, category, outcome configuration, and failure risk score.

Instructions

Get detailed information about a specific agent including its model, framework, category, outcome configuration, and failure risk score. Do NOT use for fleet-wide overviews — use get_cost_summary instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesThe agent UUID to look up

Implementation Reference

  • The main handler implementation for get_agent_detail tool. It validates the agent_id UUID parameter, makes a GET request to /agents/{agent_id}, handles errors, and formats the response using formatAgentDetail.
    // ── get_agent_detail ──
    server.registerTool(
      'get_agent_detail',
      {
        title: 'Get Agent Detail',
        description:
          'Get detailed information about a specific agent including its model, ' +
          'framework, category, outcome configuration, and failure risk score. ' +
          'Do NOT use for fleet-wide overviews — use get_cost_summary instead.',
        inputSchema: {
          agent_id: z.string().uuid().describe('The agent UUID to look up'),
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
      async ({ agent_id }) => {
        const result = await client.get<AgentDetail>(`/agents/${agent_id}`);
    
        if (result.error) {
          return {
            content: [{ type: 'text', text: `Error fetching agent: ${result.error}` }],
            isError: true,
          };
        }
    
        const text = formatAgentDetail(result.data!);
    
        return {
          content: [{ type: 'text', text }],
        };
      }
    );
  • Tool registration with input schema definition - validates agent_id as a required UUID string. Includes tool metadata like title, description, and annotations.
    server.registerTool(
      'get_agent_detail',
      {
        title: 'Get Agent Detail',
        description:
          'Get detailed information about a specific agent including its model, ' +
          'framework, category, outcome configuration, and failure risk score. ' +
          'Do NOT use for fleet-wide overviews — use get_cost_summary instead.',
        inputSchema: {
          agent_id: z.string().uuid().describe('The agent UUID to look up'),
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
  • src/index.ts:78-103 (registration)
    The registration wrapper that adds the 'metrx_' prefix to all tools. The tool registered as 'get_agent_detail' becomes 'metrx_get_agent_detail'. Also wraps handlers with rate limiting.
    const METRX_PREFIX = 'metrx_';
    const originalRegisterTool = server.registerTool.bind(server);
    (server as any).registerTool = function (
      name: string,
      config: any,
      handler: (...handlerArgs: any[]) => Promise<any>
    ) {
      const wrappedHandler = async (...handlerArgs: any[]) => {
        if (!rateLimiter.isAllowed(name)) {
          return {
            content: [
              {
                type: 'text' as const,
                text: `Rate limit exceeded for tool '${name}'. Maximum 60 requests per minute allowed.`,
              },
            ],
            isError: true,
          };
        }
        return handler(...handlerArgs);
      };
    
      // Register with metrx_ prefix (only — no deprecated aliases)
      const prefixedName = name.startsWith(METRX_PREFIX) ? name : `${METRX_PREFIX}${name}`;
      originalRegisterTool(prefixedName, config, wrappedHandler);
    };
  • Type definition for AgentDetail interface - extends AgentSummary with additional fields like description, framework_source, primary_model, failure_risk_score, etc.
    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;
    }
  • formatAgentDetail helper function that formats the AgentDetail object into a human-readable markdown string with sections for key, category, status, model, framework, risk score, etc.
    export function formatAgentDetail(agent: AgentDetail): string {
      const lines: string[] = [
        `## Agent: ${agent.name}`,
        '',
        `**Key**: ${agent.agent_key}`,
        `**Category**: ${agent.category}`,
        `**Status**: ${agent.status}`,
        `**Background**: ${agent.is_background ? 'Yes' : 'No'}`,
      ];
    
      if (agent.primary_model) {
        lines.push(`**Primary Model**: ${agent.primary_model}`);
      }
      if (agent.framework_source) {
        lines.push(`**Framework**: ${agent.framework_source}`);
      }
      if (agent.outcome_rung) {
        lines.push(`**Outcome Rung**: ${agent.outcome_rung}`);
      }
      if (agent.failure_risk_score !== undefined && agent.failure_risk_score > 0) {
        lines.push(
          `**Failure Risk**: ${formatPct(agent.failure_risk_score)} ${
            agent.failure_risk_score > 0.7 ? '🔴' : agent.failure_risk_score > 0.3 ? '🟡' : '🟢'
          }`
        );
      }
      if (agent.secondary_categories && agent.secondary_categories.length > 0) {
        lines.push(`**Secondary Categories**: ${agent.secondary_categories.join(', ')}`);
      }
      if (agent.last_call_at) {
        lines.push(`**Last Active**: ${agent.last_call_at}`);
      }
    
      return lines.join('\n');
    }
Behavior4/5

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

The description adds context about what information is included (model, framework, etc.) and the scope (specific agent vs. fleet-wide), which goes beyond the annotations. The annotations (readOnlyHint: true, destructiveHint: false, idempotentHint: true) already indicate this is a safe, non-destructive read operation, so the description doesn't need to repeat that. No contradiction with 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 two sentences that are front-loaded with the core purpose and followed by critical usage guidance. Every word serves a clear function with zero wasted text.

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?

For a simple read operation with good annotations (readOnlyHint, idempotentHint) and full schema coverage, the description is mostly complete. It specifies what information is returned and when to use it. The main gap is the lack of output schema, but the description partially compensates by listing return fields. A 5 would require more detail on output format or behavior.

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?

The description doesn't add any parameter-specific information beyond what's in the input schema. However, with 100% schema description coverage (the 'agent_id' parameter is fully documented in the schema), the baseline score is 3. The description doesn't need to compensate for schema gaps.

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 verb 'Get' and resource 'detailed information about a specific agent', listing specific attributes like model, framework, category, outcome configuration, and failure risk score. It distinguishes from the sibling tool 'get_cost_summary' by specifying this is for individual agent details, not fleet-wide overviews.

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 NOT to use this tool ('Do NOT use for fleet-wide overviews') and provides a clear alternative ('use get_cost_summary instead'). This gives precise guidance on tool selection versus sibling tools.

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