Skip to main content
Glama

get_cost_over_time

Track daily LLM costs in USD per UTC day for a workspace or pipeline to monitor spending trends, locate cost spikes, and compare periods.

Instructions

Reads the LLM cost of the workspace, or of one pipeline, per UTC day.

Use this to see how spending developed, find the day a cost spike started, or compare periods. Costs are in USD. There is one point per day with usage; days without usage are left out, so a missing day means zero cost. A cost_total of null means that day had usage but none of it was priced. Without dates the range is the last 30 days. start_date is inclusive and end_date exclusive. The daily figures leave out unpriced LLM calls; use get_cost_totals to check whether the cost is complete.

Without workspace the figures cover the whole organization, as the Cost Management page does for an organization admin; this needs the organization admin role. Use workspace for one workspace. In that organization view pipeline_name and Service names can't be used (they belong to a workspace); pass Service ids instead.

Narrow the figures with services, providers, models and api_keys. They combine: usage must match every kind you set, and any one value within a list. :param pipeline_name: Restrict to this pipeline. Omit for the whole workspace. Needs Pipelines read as well as Costs read. :param start_date: Inclusive start as an ISO timestamp. Defaults to 30 days before end_date. :param end_date: Exclusive end as an ISO timestamp. Defaults to no upper bound. :param services: Restrict to these Services (deployment in the API; a published Service endpoint, not a deployed pipeline, which is a pipeline). Each value is a Service name or its id, the key from get_cost_breakdown with group_by='deployment'. Looking a Service up by name needs Services read as well as Costs read; an id needs only Costs read. :param providers: Restrict to these providers. Use the provider ids from get_cost_breakdown with group_by='provider', such as bedrock_converse or openai, not their display names. :param models: Restrict to these models. Use the model names from get_cost_breakdown with group_by='model', exactly as returned. :param api_keys: Restrict to these API keys. Use the key ids from get_cost_breakdown with group_by='api_key', never a key's secret token. :returns: The daily cost, or an error message.

The output is automatically stored and can be referenced in other functions. Returns a formatted preview with an object ID (e.g., @obj_123). Use the object store tools in combination with the object ID to view nested properties of the object. Use the returned object ID to pass this result to other functions.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_cost_over_time"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelsNo
api_keysNo
end_dateNo
servicesNo
providersNo
start_dateNo
pipeline_nameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.45
    • addedInput schema / properties / models
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Models"
      +}
  2. Changed3 schema fields changedv0.1.40
    • addedInput schema / properties / api_keys
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Api Keys"
      +}
    • addedInput schema / properties / providers
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Providers"
      +}
    • addedInput schema / properties / services
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Services"
      +}
  3. Addedv0.1.31

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations at all, the description carries the full burden and does so: USD units, one point per day, days without usage omitted (missing day = zero cost), null cost_total meaning usage was unpriced, default 30-day window, inclusive start / exclusive end, and required permissions (org admin role; Pipelines read plus Costs read for pipeline_name; Services read only when looking a Service up by name). It also explains the org-view restriction that pipeline_name and Service names cannot be used there.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then defaults, then scope caveats, then per-parameter detail — a logical order. It is long and partially redundant: the 'Narrow the figures with services, providers, models and api_keys' paragraph overlaps the per-parameter docstring entries, and the object-store boilerplate at the end is generic filler.

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 seven-parameter, no-annotation, no-output-schema tool this is close to complete: return semantics are described ('the daily cost, or an error message' plus the object ID preview) and edge cases like unpriced usage are covered. The main defect is the dangling `workspace` parameter reference that has no counterpart in the schema.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate, and it documents all seven parameters with formats and cross-references (provider ids from get_cost_breakdown, model names exactly as returned, API key ids never the secret token, Services are deployment endpoints not pipelines). It also explains how list filters combine (AND across kinds, OR within a list). However, it repeatedly refers to a `workspace` parameter that does not exist in the input schema, which could send an agent looking for a nonexistent field.

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 plus the aggregation granularity: 'Reads the LLM cost of the workspace, or of one pipeline, per UTC day.' That distinguishes it cleanly from get_cost_breakdown (grouping) and get_cost_totals (completeness totals).

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?

Gives concrete when-to-use scenarios ('see how spending developed, find the day a cost spike started, or compare periods') and explicitly routes to a sibling for a related need: 'use get_cost_totals to check whether the cost is complete.' It also explains scope selection (organization-wide vs one workspace) and the role prerequisites for each.

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

Deploy Server

Other Tools