Skip to main content
Glama
Metrx MCP Server

Metrx MCP Server

by metrxbots

Get Agent ROI

metrx_get_task_roi
Read-onlyIdempotent

Calculate return on investment for an agent. Shows total costs (LLM API calls), total outcomes (attributed business value), ROI multiplier, and breakdown by model and outcome type.

Instructions

Calculate return on investment for an agent. Shows total costs (LLM API calls), total outcomes (attributed business value), ROI multiplier, and breakdown by model and outcome type. Useful for identifying which agents generate the most value per dollar spent. Do NOT use for ROI across all agents — use generate_roi_audit for that. Requires an API key with the 'read' scope.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "agent_id": "<agent_id>"
    },
    "name": "metrx_get_task_roi"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoNumber of days to analyze (default: 30)
agent_idYesThe agent UUID to calculate ROI for

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. The description adds the return payload (total costs, total outcomes, ROI multiplier, breakdowns by model and outcome type) and the API key scope requirement, which is genuine value beyond the structured data. It stops short of disclosing latency, caching, or what happens when no outcomes are attributed in the window.

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?

Four short sentences, front-loaded with the verb+resource, then what it returns, then the use case, then the exclusion and prerequisite. No sentence is redundant or restates the name.

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

Completeness5/5

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

With only two parameters, full schema coverage, and no output schema, the description carries the return-value burden and does so by enumerating the report contents. Access prerequisites and sibling routing are both present, so nothing material is missing for correct invocation.

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 agent_id and the days window (with its 1–365 bounds and default of 30) are fully documented in the schema. The description adds no additional semantics about how 'days' interacts with attribution timing, so the baseline of 3 applies.

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?

States a specific verb and resource — 'Calculate return on investment for an agent' — and immediately scopes it to a single agent, which separates it from the fleet-wide audit sibling. An agent can distinguish this from metrx_generate_roi_audit without opening either schema.

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?

Explicitly names the alternative ('use generate_roi_audit' for ROI across all agents) and gives the selecting condition, plus a stated use case ('identifying which agents generate the most value per dollar spent'). Prerequisite access requirement ('read' scope) is also stated, leaving little to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.