Skip to main content
Glama

Latency Lab

analyze_agent_latency
Read-onlyIdempotent

Find slow agent workflows and retry overhead before scaling. Supply recorded attempts with task_id, workflow, variant, cost_usd, success and optional latency_ms. Returns P50/P95 of summed recorded attempt durations per task, retry counts, duration coverage and an optional P95 threshold check for each workflow and variant. Missing durations produce null percentiles, not zero latency. This measures supplied durations, not live end-to-end service latency. Free calculation; requires an active ALPNAI agent key; no payment or automatic deployment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
runsYes
configNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupsYes
measurementYes
schema_versionYes
percentile_methodYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • addedInput schema / description
      Added value: +"Recorded attempts, not prompts or secrets. Identical rows count as separate attempts. All three analysis tools accept this same input. The runtime validator additionally enforces six-decimal micro-USD precision, the same task_id belonging to one workflow, one workflow when monthlyTasks is given, and UTF-16 length limits. HTTP body limit: 512000 UTF-8 bytes."
    • addedInput schema / properties / config / additionalProperties
      Added value: +false
    • addedInput schema / properties / config / properties
      Added value: +{
      +  "maxP95LatencyMs": {
      +    "maximum": 86400000000,
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  "maxSuccessRateDrop": {
      +    "default": 0.02,
      +    "maximum": 1,
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  "minSamples": {
      +    "default": 30,
      +    "maximum": 500,
      +    "minimum": 2,
      +    "type": "integer"
      +  },
      +  "minSuccessRate": {
      +    "default": 0.95,
      +    "maximum": 1,
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  "monthlyTasks": {
      +    "description": "Baseline logical tasks launched per month; the engine requires exactly one workflow if supplied.",
      +    "maximum": 1000000,
      +    "minimum": 1,
      +    "type": "integer"
      +  }
      +}
    • addedInput schema / properties / config / required
      Added value: +[]
    • addedInput schema / properties / runs / items / additionalProperties
      Added value: +false
    • addedInput schema / properties / runs / items / properties
      Added value: +{
      +  "cost_usd": {
      +    "description": "USD cost of this attempt. At most six decimal places; the engine verifies whole micro-USD using floating-point tolerance. No multipleOf keyword is used, to avoid rejecting valid JSON decimals.",
      +    "maximum": 10000,
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  "latency_ms": {
      +    "description": "Recorded attempt duration in milliseconds; decimals are accepted. Omit if not measured.",
      +    "maximum": 86400000,
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  "success": {
      +    "type": "boolean"
      +  },
      +  "task_id": {
      +    "description": "Nonempty, no control characters or surrounding whitespace. The engine additionally enforces at most 128 UTF-16 code units.",
      +    "maxLength": 128,
      +    "minLength": 1,
      +    "pattern": "^(?!\\s)(?![\\s\\S]*\\s$)[^\\u0000-\\u001F\\u007F]+$",
      +    "type": "string"
      +  },
      +  "variant": {
      +    "enum": [
      +      "baseline",
      +      "candidate"
      +    ],
      +    "type": "string"
      +  },
      +  "workflow": {
      +    "description": "Nonempty, no control characters or surrounding whitespace. The engine additionally enforces at most 80 UTF-16 code units.",
      +    "maxLength": 80,
      +    "minLength": 1,
      +    "pattern": "^(?!\\s)(?![\\s\\S]*\\s$)[^\\u0000-\\u001F\\u007F]+$",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / runs / items / required
      Added value: +[
      +  "task_id",
      +  "workflow",
      +  "variant",
      +  "cost_usd",
      +  "success"
      +]
    • addedInput schema / title
      Added value: +"ALPNAI recorded agent attempts"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "groups": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "duration_coverage": {
      +            "maximum": 1,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "max_ms": {
      +            "anyOf": [
      +              {
      +                "maximum": 86400000000,
      +                "minimum": 0,
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "p50_ms": {
      +            "anyOf": [
      +              {
      +                "maximum": 86400000000,
      +                "minimum": 0,
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "p95_ms": {
      +            "anyOf": [
      +              {
      +                "maximum": 86400000000,
      +                "minimum": 0,
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "recorded_attempts": {
      +            "maximum": 1000,
      +            "minimum": 1,
      +            "type": "integer"
      +          },
      +          "retry_attempts": {
      +            "maximum": 999,
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "tasks": {
      +            "maximum": 1000,
      +            "minimum": 1,
      +            "type": "integer"
      +          },
      +          "threshold_ms": {
      +            "anyOf": [
      +              {
      +                "maximum": 86400000000,
      +                "minimum": 0,
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "variant": {
      +            "enum": [
      +              "baseline",
      +              "candidate"
      +            ],
      +            "type": "string"
      +          },
      +          "within_p95_threshold": {
      +            "anyOf": [
      +              {
      +                "type": "boolean"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "workflow": {
      +            "description": "Nonempty, no control characters or surrounding whitespace. The engine additionally enforces at most 80 UTF-16 code units.",
      +            "maxLength": 80,
      +            "minLength": 1,
      +            "pattern": "^(?!\\s)(?![\\s\\S]*\\s$)[^\\u0000-\\u001F\\u007F]+$",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "workflow",
      +          "variant",
      +          "tasks",
      +          "recorded_attempts",
      +          "retry_attempts",
      +          "duration_coverage",
      +          "p50_ms",
      +          "p95_ms",
      +          "max_ms",
      +          "threshold_ms",
      +          "within_p95_threshold"
      +        ],
      +        "type": "object"
      +      },
      +      "maxItems": 1000,
      +      "minItems": 1,
      +      "type": "array"
      +    },
      +    "measurement": {
      +      "const": "summed_recorded_attempt_durations_per_task",
      +      "type": "string"
      +    },
      +    "percentile_method": {
      +      "const": "nearest_rank",
      +      "type": "string"
      +    },
      +    "schema_version": {
      +      "const": "1.0.0",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "schema_version",
      +    "measurement",
      +    "percentile_method",
      +    "groups"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, the description adds critical behavior: missing durations yield null percentiles rather than zero, the calculation is free and requires only an active key, and no payment or deployment occurs. It also clarifies that it analyzes supplied durations, not live service latency.

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?

Every sentence earns its place: purpose, input shape, output summary, edge-case behavior, and operational constraints. It is front-loaded and compact despite covering many important caveats.

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?

Given the rich input schema and output schema, the description fully equips the agent to understand input expectations, key output metrics, missing-data semantics, authentication needs, and non-deployment behavior. Nothing essential for correct invocation is missing.

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?

With top-level schema description coverage at 0%, the description partially compensates by listing the required attempt fields and optional latency_ms. However, it gives only a vague nod to the config object ('optional P95 threshold check') and does not explain minSamples, minSuccessRate, monthlyTasks, or maxSuccessRateDrop.

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 opens with a specific, actionable purpose: 'Find slow agent workflows and retry overhead before scaling.' It clearly identifies the resource (recorded agent attempts) and differentiates itself from the cost/quality-focused sibling tools by focusing on latency and retry counts.

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

Usage Guidelines4/5

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

It provides a clear use case ('before scaling') and an explicit exclusion ('not live end-to-end service latency'). It stops short of naming alternatives like audit_agent_costs or check_agent_quality, so some routing judgment is still left to the agent.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources