Skip to main content
Glama

Spend Proof cost analysis

audit_agent_costs
Read-onlyIdempotent

Free comparison of cost per successful task on supplied paired traces. Requires a sandbox agent key. No purchase, storage, external model call or automatic deployment. Success labels are supplied by the client.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
runsYes
configNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
configYes
purposeYes
workflowsYes
methodologyYes
schema_versionYes
data_provenanceYes
input_attempt_recordsYes
experimental_bias_controlYes
automatic_deployment_authorizedYes

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": {
      +    "automatic_deployment_authorized": {
      +      "const": false,
      +      "type": "boolean"
      +    },
      +    "config": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "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"
      +        }
      +      },
      +      "required": [
      +        "minSamples",
      +        "minSuccessRate",
      +        "maxSuccessRateDrop"
      +      ],
      +      "type": "object"
      +    },
      +    "data_provenance": {
      +      "const": "user_supplied_not_verified",
      +      "type": "string"
      +    },
      +    "experimental_bias_control": {
      +      "const": "unknown",
      +      "type": "string"
      +    },
      +    "input_attempt_records": {
      +      "maximum": 1000,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    "methodology": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "duplicates": {
      +          "type": "string"
      +        },
      +        "latency": {
      +          "type": "string"
      +        },
      +        "logical_task_key": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "maxItems": 3,
      +          "minItems": 3,
      +          "type": "array"
      +        },
      +        "missing_costs": {
      +          "type": "string"
      +        },
      +        "quality": {
      +          "type": "string"
      +        },
      +        "success": {
      +          "type": "string"
      +        },
      +        "uncertainty": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "logical_task_key",
      +        "success",
      +        "duplicates",
      +        "latency",
      +        "quality",
      +        "uncertainty",
      +        "missing_costs"
      +      ],
      +      "type": "object"
      +    },
      +    "purpose": {
      +      "const": "cost_per_successful_agent_task_audit",
      +      "type": "string"
      +    },
      +    "schema_version": {
      +      "const": "1.0.0",
      +      "type": "string"
      +    },
      +    "workflows": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "automatic_deployment_authorized": {
      +            "const": false,
      +            "type": "boolean"
      +          },
      +          "baseline": {
      +            "anyOf": [
      +              {
      +                "additionalProperties": true,
      +                "properties": {
      +                  "attempts": {
      +                    "maximum": 1000,
      +                    "minimum": 1,
      +                    "type": "integer"
      +                  },
      +                  "cost_per_successful_task_usd": {
      +                    "anyOf": [
      +                      {
      +                        "minimum": 0,
      +                        "type": "number"
      +                      },
      +                      {
      +                        "type": "null"
      +                      }
      +                    ]
      +                  },
      +                  "cost_per_task_usd": {
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "latency_complete": {
      +                    "type": "boolean"
      +                  },
      +                  "p95_recorded_attempt_latency_per_task_ms": {
      +                    "anyOf": [
      +                      {
      +                        "maximum": 86400000000,
      +                        "minimum": 0,
      +                        "type": "number"
      +                      },
      +                      {
      +                        "type": "null"
      +                      }
      +                    ]
      +                  },
      +                  "retry_attempts": {
      +                    "maximum": 999,
      +                    "minimum": 0,
      +                    "type": "integer"
      +                  },
      +                  "success_rate": {
      +                    "maximum": 1,
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "success_rate_interval_95_wilson": {
      +                    "items": {
      +                      "maximum": 1,
      +                      "minimum": 0,
      +                      "type": "number"
      +                    },
      +                    "maxItems": 2,
      +                    "minItems": 2,
      +                    "type": "array"
      +                  },
      +                  "successful_tasks": {
      +                    "maximum": 1000,
      +                    "minimum": 0,
      +                    "type": "integer"
      +                  },
      +                  "tasks": {
      +                    "maximum": 1000,
      +                    "minimum": 1,
      +                    "type": "integer"
      +                  },
      +                  "total_cost_usd": {
      +                    "minimum": 0,
      +                    "type": "number"
      +                  }
      +                },
      +                "required": [
      +                  "tasks",
      +                  "attempts",
      +                  "retry_attempts",
      +                  "successful_tasks",
      +                  "total_cost_usd",
      +                  "cost_per_task_usd",
      +                  "cost_per_successful_task_usd",
      +                  "success_rate",
      +                  "success_rate_interval_95_wilson",
      +                  "p95_recorded_attempt_latency_per_task_ms",
      +                  "latency_complete"
      +                ],
      +                "type": "object"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "candidate": {
      +            "anyOf": [
      +              {
      +                "additionalProperties": true,
      +                "properties": {
      +                  "attempts": {
      +                    "maximum": 1000,
      +                    "minimum": 1,
      +                    "type": "integer"
      +                  },
      +                  "cost_per_successful_task_usd": {
      +                    "anyOf": [
      +                      {
      +                        "minimum": 0,
      +                        "type": "number"
      +                      },
      +                      {
      +                        "type": "null"
      +                      }
      +                    ]
      +                  },
      +                  "cost_per_task_usd": {
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "latency_complete": {
      +                    "type": "boolean"
      +                  },
      +                  "p95_recorded_attempt_latency_per_task_ms": {
      +                    "anyOf": [
      +                      {
      +                        "maximum": 86400000000,
      +                        "minimum": 0,
      +                        "type": "number"
      +                      },
      +                      {
      +                        "type": "null"
      +                      }
      +                    ]
      +                  },
      +                  "retry_attempts": {
      +                    "maximum": 999,
      +                    "minimum": 0,
      +                    "type": "integer"
      +                  },
      +                  "success_rate": {
      +                    "maximum": 1,
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "success_rate_interval_95_wilson": {
      +                    "items": {
      +                      "maximum": 1,
      +                      "minimum": 0,
      +                      "type": "number"
      +                    },
      +                    "maxItems": 2,
      +                    "minItems": 2,
      +                    "type": "array"
      +                  },
      +                  "successful_tasks": {
      +                    "maximum": 1000,
      +                    "minimum": 0,
      +                    "type": "integer"
      +                  },
      +                  "tasks": {
      +                    "maximum": 1000,
      +                    "minimum": 1,
      +                    "type": "integer"
      +                  },
      +                  "total_cost_usd": {
      +                    "minimum": 0,
      +                    "type": "number"
      +                  }
      +                },
      +                "required": [
      +                  "tasks",
      +                  "attempts",
      +                  "retry_attempts",
      +                  "successful_tasks",
      +                  "total_cost_usd",
      +                  "cost_per_task_usd",
      +                  "cost_per_successful_task_usd",
      +                  "success_rate",
      +                  "success_rate_interval_95_wilson",
      +                  "p95_recorded_attempt_latency_per_task_ms",
      +                  "latency_complete"
      +                ],
      +                "type": "object"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "comparison": {
      +            "additionalProperties": true,
      +            "properties": {
      +              "baseline_only_tasks": {
      +                "maximum": 1000,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "candidate_only_tasks": {
      +                "maximum": 1000,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "matched_task_ids": {
      +                "maximum": 1000,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "same_task_set": {
      +                "type": "boolean"
      +              }
      +            },
      +            "required": [
      +              "matched_task_ids",
      +              "baseline_only_tasks",
      +              "candidate_only_tasks",
      +              "same_task_set"
      +            ],
      +            "type": "object"
      +          },
      +          "decision": {
      +            "enum": [
      +              "missing_comparison",
      +              "collect_more_data",
      +              "quality_regression",
      +              "latency_data_required",
      +              "latency_regression",
      +              "no_economic_advantage",
      +              "candidate_for_controlled_trial"
      +            ],
      +            "type": "string"
      +          },
      +          "gates": {
      +            "additionalProperties": true,
      +            "properties": {
      +              "both_variants": {
      +                "enum": [
      +                  "pass",
      +                  "fail",
      +                  "unknown",
      +                  "not_requested"
      +                ],
      +                "type": "string"
      +              },
      +              "experimental_bias_control": {
      +                "const": "unknown",
      +                "type": "string"
      +              },
      +              "lower_cost_per_successful_task": {
      +                "enum": [
      +                  "pass",
      +                  "fail",
      +                  "unknown",
      +                  "not_requested"
      +                ],
      +                "type": "string"
      +              },
      +              "minimum_distinct_tasks_per_variant": {
      +                "enum": [
      +                  "pass",
      +                  "fail",
      +                  "unknown",
      +                  "not_requested"
      +                ],
      +                "type": "string"
      +              },
      +              "observed_success_rate": {
      +                "enum": [
      +                  "pass",
      +                  "fail",
      +                  "unknown",
      +                  "not_requested"
      +                ],
      +                "type": "string"
      +              },
      +              "recorded_latency": {
      +                "enum": [
      +                  "pass",
      +                  "fail",
      +                  "unknown",
      +                  "not_requested"
      +                ],
      +                "type": "string"
      +              },
      +              "same_task_set": {
      +                "enum": [
      +                  "pass",
      +                  "fail",
      +                  "unknown",
      +                  "not_requested"
      +                ],
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "both_variants",
      +              "minimum_distinct_tasks_per_variant",
      +              "same_task_set",
      +              "observed_success_rate",
      +              "recorded_latency",
      +              "lower_cost_per_successful_task",
      +              "experimental_bias_control"
      +            ],
      +            "type": "object"
      +          },
      +          "opportunity_monthly": {
      +            "anyOf": [
      +              {
      +                "additionalProperties": true,
      +                "properties": {
      +                  "baseline_expected_cost_usd": {
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "baseline_launched_tasks_per_month": {
      +                    "maximum": 1000000,
      +                    "minimum": 1,
      +                    "type": "integer"
      +                  },
      +                  "basis": {
      +                    "const": "same_expected_successful_task_volume",
      +                    "type": "string"
      +                  },
      +                  "candidate_expected_cost_usd": {
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "candidate_expected_launched_tasks_per_month": {
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "conditions": {
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "minItems": 1,
      +                    "type": "array"
      +                  },
      +                  "currency": {
      +                    "const": "USD",
      +                    "type": "string"
      +                  },
      +                  "excludes": {
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "minItems": 1,
      +                    "type": "array"
      +                  },
      +                  "expected_successful_tasks_per_month": {
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "period": {
      +                    "const": "month",
      +                    "type": "string"
      +                  },
      +                  "potential_cost_difference_usd": {
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "status": {
      +                    "const": "conditional_projection_not_realized",
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "status",
      +                  "basis",
      +                  "currency",
      +                  "period",
      +                  "baseline_launched_tasks_per_month",
      +                  "expected_successful_tasks_per_month",
      +                  "candidate_expected_launched_tasks_per_month",
      +                  "baseline_expected_cost_usd",
      +                  "candidate_expected_cost_usd",
      +                  "potential_cost_difference_usd",
      +                  "excludes",
      +                  "conditions"
      +                ],
      +                "type": "object"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "realized_savings_usd": {
      +            "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",
      +          "baseline",
      +          "candidate",
      +          "comparison",
      +          "gates",
      +          "decision",
      +          "automatic_deployment_authorized",
      +          "realized_savings_usd",
      +          "opportunity_monthly"
      +        ],
      +        "type": "object"
      +      },
      +      "maxItems": 1000,
      +      "minItems": 1,
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "schema_version",
      +    "purpose",
      +    "data_provenance",
      +    "config",
      +    "input_attempt_records",
      +    "experimental_bias_control",
      +    "automatic_deployment_authorized",
      +    "methodology",
      +    "workflows"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

B3.3/5.0
Behavior4/5

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

Annotations already indicate read-only and idempotent, and the description adds valuable context: it explicitly states no purchase, storage, external model call, or automatic deployment, and that success labels are client-supplied. It also notes the sandbox key requirement, which is an operational constraint. 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 four short sentences with no fluff. The main purpose is front-loaded, and the caveats are listed efficiently. Every sentence adds value.

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?

Given the tool's complexity (nested runs array with many fields and a config object), the description is minimal. It doesn't explain the expected input structure beyond 'paired traces', nor does it clarify the baseline/candidate semantics that the variant field implies. However, the output schema exists, so return values are covered. The description covers key constraints like the sandbox key and no external calls, but could benefit from a note on how to structure runs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description does not mention any parameters, and schema description coverage is 0%, so it fails to compensate for the schema's lack of explanatory text. The schema itself has some descriptions for fields like task_id and cost_usd, but the tool description adds no meaning. The 'paired traces' phrase hints at the variant field, but it's insufficient.

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 states a specific verb (compare) and resource (cost per successful task) on paired traces, making the tool's function clear. It does not explicitly name sibling alternatives, but the purpose is unambiguous. The phrase 'paired traces' hints at the baseline/candidate input structure.

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?

The description gives no guidance on when to use this tool versus analyze_agent_latency or check_agent_quality. It only mentions a prerequisite (sandbox agent key) but not selection criteria. This is a significant gap for an agent deciding between analysis tools.

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