Skip to main content
Glama

Costory: Your Finops MCP

find_cost_change_factors

Read-only

Find which dimension values drove a cost change between two periods. Use when the user asks why costs changed between two periods. This is a before/after analysis — compare is required ({} auto-derives the previous window, same as query). When dimension names are unknown, discover them with suggest_groupby / search / get_context, then pass 2–4 columns (max 8). Do not invent columns. filterCel omitted or "" is unfiltered (not AWS-only). nestingEdges: a child's spend sits inside the parent — do not sum a contributor with its ancestors or descendants; independent contributors may be summed. aggregationMethod defaults to SUM; set AVG only when the user asks for an average. Effects: Read-only retrieval or computation; does not change saved resources or send messages. Scope: Authorized Costory workspace only. EXAMPLES: • "Why did last month's EC2 cost change?" → { datePreset: "LAST_MONTH", compare: {}, filterCel: "cos_service_name in ["AmazonEC2"]", columns: ["cos_region", "cos_usage_type"] } • "What drove the RDS jump in May?" → { from: "2026-05-01", to: "2026-05-31", compare: { from: "2026-04-01", to: "2026-04-30" }, filterCel: "cos_provider in ["AWS"] && cos_service_name in ["AmazonRDS"]", columns: ["cos_sub_account_id", { column: "cos_charge_description", contains: "IOPS" }] }

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": {
      "compare": "<compare>",
      "columns": "<columns>"
    },
    "name": "find_cost_change_factors"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoCurrent period end (YYYY-MM-DD), inclusive. Omit when using datePreset.
fromNoCurrent period start (YYYY-MM-DD). Omit when using datePreset.
slugNoOrganization slug. Omit to auto-detect from your account (fails if you belong to multiple orgs).
columnsYes2–4 dimensions to investigate (max 8). Use names returned by suggest_groupby / search / get_context (e.g. "cos_service_name"), or { column, contains } for a single-token substring (e.g. { column: "cos_charge_description", contains: "GPU" }). Do not invent columns.
compareYesPrevious period. `{}` auto-derives from the current window (same helper as query). `{ from, to }` pins it.
contextNoOptional context used only for analytics; it does not affect tool execution. Omit it by default. Do not include conversation text, personal information, or workspace data.
filterCelNoOptional CEL scope. Omit or "" for unfiltered (Billy where_clause TRUE). That is not an AWS-only filter even though columns_where_clause falls back to ["cos_provider"]. String methods: field.contains("x"), field.startsWith("x"), field.endsWith("x") (method-call, not infix). Unsupported CEL functions (e.g. lowerAscii) return INVALID_QUERY.
llm_modelNoThe model identifier you are running as, for example "claude-opus-4-8" or "gpt-5.2". Pass "unknown" if you are not certain. Recorded for the server developer's analytics.
datePresetNo
conversation_idNoThe conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics.
aggregationMethodNoDefault is SUM. Set AVG only when the user asks for an average.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / filterCel / description
      Previous value: -"Optional CEL scope. Omit or \"\" for unfiltered (Billy where_clause TRUE). That is not an AWS-only filter even though columns_where_clause falls back to [\"cos_provider\"]. Unsupported CEL functions (e.g. lowerAscii) return INVALID_QUERY."New value: +"Optional CEL scope. Omit or \"\" for unfiltered (Billy where_clause TRUE). That is not an AWS-only filter even though columns_where_clause falls back to [\"cos_provider\"]. String methods: field.contains(\"x\"), field.startsWith(\"x\"), field.endsWith(\"x\") (method-call, not infix). Unsupported CEL functions (e.g. lowerAscii) return INVALID_QUERY."
  2. Changed2 schema fields changed
    • changedInput schema / properties / context / description
      Previous value: -"A few words on why you are calling this tool, for the server developer's analytics. Describe people and things by role, such as \"a customer\". Do not quote the user or include names, emails, or other personal details."New value: +"Optional context used only for analytics; it does not affect tool execution. Omit it by default. Do not include conversation text, personal information, or workspace data."
    • changedInput schema / required
      Previous value: -[
      -  "compare",
      -  "columns",
      -  "context"
      -]New value: +[
      +  "compare",
      +  "columns"
      +]
  3. Changed1 schema field changed
    • changedInput schema / properties / filterCel / description
      Previous value: -"Optional CEL scope. Omit or \"\" for unfiltered (Billy where_clause TRUE). That is not an AWS-only filter even though columns_where_clause falls back to [\"cos_provider\"]."New value: +"Optional CEL scope. Omit or \"\" for unfiltered (Billy where_clause TRUE). That is not an AWS-only filter even though columns_where_clause falls back to [\"cos_provider\"]. Unsupported CEL functions (e.g. lowerAscii) return INVALID_QUERY."
  4. Changed4 schema fields changed
    • changedInput schema / properties / aggregationMethod / description
      Previous value: -"Prefer omitting this (SUM). AVG is rarely right for cost."New value: +"Default is SUM. Set AVG only when the user asks for an average."
    • changedInput schema / properties / columns / description
      Previous value: -"2–4 dimensions to investigate (max 8). Prefer suggest_groupby / search / get_context names (e.g. \"cos_service_name\"), or { column, contains } for a single-token substring (e.g. { column: \"cos_charge_description\", contains: \"GPU\" }). Do not invent columns."New value: +"2–4 dimensions to investigate (max 8). Use names returned by suggest_groupby / search / get_context (e.g. \"cos_service_name\"), or { column, contains } for a single-token substring (e.g. { column: \"cos_charge_description\", contains: \"GPU\" }). Do not invent columns."
    • changedInput schema / properties / context / description
      Previous value: -"Explain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as \"a user\", \"the customer\", or \"an account\". Example: \"Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution.\""New value: +"A few words on why you are calling this tool, for the server developer's analytics. Describe people and things by role, such as \"a customer\". Do not quote the user or include names, emails, or other personal details."
    • changedInput schema / required
      Previous value: -[
      -  "compare",
      -  "columns",
      -  "context",
      -  "llm_model"
      -]New value: +[
      +  "compare",
      +  "columns",
      +  "context"
      +]
  5. Changed4 schema fields changed
    • addedInput schema / properties / context
      Added value: +{
      +  "description": "Explain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as \"a user\", \"the customer\", or \"an account\". Example: \"Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution.\"",
      +  "type": "string"
      +}
    • addedInput schema / properties / conversation_id
      Added value: +{
      +  "description": "The conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics.",
      +  "type": "string"
      +}
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "The model identifier you are running as, for example \"claude-opus-4-8\" or \"gpt-5.2\". Pass \"unknown\" if you are not certain. Recorded for the server developer's analytics.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "compare",
      -  "columns"
      -]New value: +[
      +  "compare",
      +  "columns",
      +  "context",
      +  "llm_model"
      +]
  6. Changed2 schema fields changed
    • removedInput schema / properties / filterCel / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / filterCel / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  7. Changed1 schema field changed
    • changedInput schema / properties / datePreset / enum
      Previous value: -[
      -  "TRAILING_90_DAYS",
      -  "TRAILING_30_DAYS",
      -  "TRAILING_45_DAYS",
      -  "TRAILING_7_DAYS",
      -  "TRAILING_3_DAYS",
      -  "TRAILING_14_WEEKS",
      -  "MTD",
      -  "QTD",
      -  "YTD",
      -  "CURRENT_MONTH",
      -  "CURRENT_QUARTER",
      -  "CURRENT_YEAR",
      -  "LAST_WEEK",
      -  "LAST_MONTH",
      -  "LAST_6_MONTHS",
      -  "LAST_12_MONTHS",
      -  "LAST_4_YEARS",
      -  "LAST_3_MONTHS",
      -  "LAST_INVOICE_MONTH"
      -]New value: +[
      +  "TRAILING_90_DAYS",
      +  "TRAILING_30_DAYS",
      +  "TRAILING_45_DAYS",
      +  "TRAILING_7_DAYS",
      +  "TRAILING_3_DAYS",
      +  "TRAILING_1_DAYS",
      +  "TRAILING_14_WEEKS",
      +  "MTD",
      +  "QTD",
      +  "YTD",
      +  "CURRENT_MONTH",
      +  "CURRENT_QUARTER",
      +  "CURRENT_YEAR",
      +  "LAST_WEEK",
      +  "LAST_MONTH",
      +  "LAST_6_MONTHS",
      +  "LAST_12_MONTHS",
      +  "LAST_4_YEARS",
      +  "LAST_3_MONTHS",
      +  "LAST_INVOICE_MONTH"
      +]
  8. Changed1 schema field changed
    • changedInput schema / properties / datePreset / enum
      Previous value: -[
      -  "TRAILING_90_DAYS",
      -  "TRAILING_30_DAYS",
      -  "TRAILING_45_DAYS",
      -  "TRAILING_7_DAYS",
      -  "TRAILING_3_DAYS",
      -  "TRAILING_14_WEEKS",
      -  "MTD",
      -  "QTD",
      -  "YTD",
      -  "LAST_WEEK",
      -  "LAST_MONTH",
      -  "LAST_6_MONTHS",
      -  "LAST_12_MONTHS",
      -  "LAST_4_YEARS",
      -  "LAST_3_MONTHS",
      -  "LAST_INVOICE_MONTH"
      -]New value: +[
      +  "TRAILING_90_DAYS",
      +  "TRAILING_30_DAYS",
      +  "TRAILING_45_DAYS",
      +  "TRAILING_7_DAYS",
      +  "TRAILING_3_DAYS",
      +  "TRAILING_14_WEEKS",
      +  "MTD",
      +  "QTD",
      +  "YTD",
      +  "CURRENT_MONTH",
      +  "CURRENT_QUARTER",
      +  "CURRENT_YEAR",
      +  "LAST_WEEK",
      +  "LAST_MONTH",
      +  "LAST_6_MONTHS",
      +  "LAST_12_MONTHS",
      +  "LAST_4_YEARS",
      +  "LAST_3_MONTHS",
      +  "LAST_INVOICE_MONTH"
      +]
  9. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover read-only/no-destruction, and the description's "Effects" line largely restates them. It earns credit for non-obvious behavior the schema does not express: the unfiltered default is not an AWS-only filter despite the columns_where_clause fallback, unsupported CEL functions return INVALID_QUERY, and parent/child spend nesting must not be double-summed. Missing: how large a result set comes back and whether it is truncated.

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-loads the purpose and the when-to-use trigger, then groups operational constraints before the examples. A few lines are duplicated from the schema ("Do not invent columns", max 8), and the worked examples add length, though they are genuinely illustrative of column and filter composition.

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?

Eleven parameters with a nested compare object and no output schema, yet the description supplies scope, effects, earlier-window semantics, and two concrete call shapes. The nestingEdges guidance partially describes result structure, but how contributor rows are shaped and ranked is still left implicit for a non-trivial analytical tool.

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?

With 91% schema coverage the baseline is 3, and the description adds real meaning on top: compare is required and `{}` auto-derives from the current window, filterCel omitted or "" means unfiltered, and 2–4 columns is the practical range within the hard max of 8. Minor blemish: it explains "nestingEdges", a concept absent from the input schema, which may confuse an agent mapping description to parameters.

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: "Find which dimension values drove a cost change between two periods." That cleanly separates it from query (time-series totals) and search (record lookup) and tells the agent the output is a ranked set of dimension contributors.

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?

Explicit trigger ("Use when the user asks why costs changed between two periods"), explicit prerequisite discovery path (suggest_groupby / search / get_context before naming columns), and explicit prohibitions ("Do not invent columns", "do not sum a contributor with its ancestors"). Default rules for aggregationMethod (SUM unless the user asks for an average) remove the remaining guesswork.

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