Skip to main content
Glama

get_cost_breakdown

Reads the LLM cost of the workspace, or of one pipeline, grouped by model, pipeline, deployment or API key.

Instructions

Reads the LLM cost of the workspace, or of one pipeline, grouped by model, pipeline, deployment or API key.

Use this to find what drove the cost: which models, pipelines, deployments or API keys spent the most. Costs are in USD. Results are sorted by cost, highest first, unless you set sort_by and sort_order. Each entry has a key (a model or provider name, or a UUID for the other dimensions) and a readable label. A deleted pipeline still shows up with group_by='pipeline', labelled with its UUID. total is the number of groups across all pages; when has_more is true, read the next page_number. total_requests counts queries, not individual LLM calls. A cost_total of null means the group had usage but none of it was priced. Without dates the range is the last 30 days. :param group_by: The dimension to group by: model, workspace, pipeline, deployment, api_key or provider. :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 sort_by: Sort by label, cost_total, total_tokens or total_requests. Defaults to cost_total. :param sort_order: ASC or DESC. Defaults to DESC. :param limit: Groups per page, from 1 to 100. :param page_number: The page to read, starting at 1. :returns: One page of the breakdown, 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
sort_byNo
end_dateNo
group_byYes
sort_orderNo
start_dateNo
page_numberNo
pipeline_nameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.31

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: sort defaults, pagination semantics (total across all pages, has_more, page_number), that total_requests counts queries not LLM calls, that a null cost_total means unpriced usage, the 30-day default window, that deleted pipelines still appear with a UUID label, and the required Pipelines read + Costs read permissions.

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?

The core is well front-loaded: purpose, then the 'what drove the cost' framing, then parameter details. It is dense but nearly every sentence adds information; the trailing object-store boilerplate is the only portion that is generic filler.

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?

There is no output schema, yet the description explains the return shape (key/label entries, total, total_requests, cost_total nullability) and the object-store handoff via an @obj_123 ID. An agent has everything needed to call the tool and interpret results.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must document all eight parameters, and it does: group_by dimensions, pipeline_name scope plus its permission prerequisite, inclusive/exclusive date semantics with defaults, sort_by/sort_order options and defaults, limit range (1-100), and page_number starting at 1.

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?

States a specific verb and resource (reads LLM cost), names the scope (workspace or one pipeline) and the grouping dimensions. The phrase 'grouped by model, pipeline, deployment or API key' implicitly separates it from the totals and over-time siblings, but it never names them explicitly, so an agent must infer the distinction.

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?

'Use this to find what drove the cost: which models, pipelines, deployments or API keys spent the most' tells the agent exactly when this tool is the right pick. There is no explicit when-not guidance or named alternative (e.g. get_cost_totals, get_cost_over_time), so it stops short of a 5.

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