Skip to main content
Glama
chaandannn

nable (finops-mcp)

get_langfuse_model_costs

Analyze LLM costs and token usage by model from Langfuse. Understand which models drive spend and optimize model selection based on cost-per-1k-token efficiency.

Instructions

Break down LLM spend and token usage by model from Langfuse observability data.

Shows cost and token consumption for every model tracked in Langfuse, useful for understanding which models are driving spend and optimizing model selection.

Requires: LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY in environment. Optional: LANGFUSE_HOST (defaults to https://cloud.langfuse.com)

Args: days: lookback window in days (default 30, ignored if start/end provided) start_date: ISO date string YYYY-MM-DD end_date: ISO date string YYYY-MM-DD

Returns cost per model, tokens per model, and cost-per-1k-token efficiency.

Examples: - "Show me our LLM costs by model in Langfuse" - "Which model is costing us the most in Langfuse?" - "What's our cost per 1k tokens for GPT-4 vs Claude?"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo
end_dateNo
start_dateNo
Behavior4/5

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

Discloses that it is a read-only operation returning cost and token metrics per model. Mentions required environment variables and optional host. Does not mention rate limits or error handling, but these are minor gaps given the simple read nature.

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?

Concise and well-structured: opens with a clear main purpose, followed by a brief detail, then requirements, args, return, and examples. Every sentence adds value, with no redundancy.

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?

Completely covers all necessary information: inputs (3 params), outputs (cost per model, tokens, efficiency), prerequisites, and usage examples. Given no output schema or enums, the description is sufficient for correct usage.

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?

Adds significant meaning beyond the input schema: explains 'days' as a lookback window with default and that it's ignored if start/end are provided, and describes start_date and end_date as ISO strings. This fully compensates for the 0% schema description coverage.

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?

Clearly states it breaks down LLM spend and token usage by model from Langfuse observability data. The verb 'break down' and resource 'LLM spend and token usage by model' are specific. It distinguishes from siblings like get_llm_cost_by_model by specifying the Langfuse data source.

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

Usage Guidelines3/5

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

Provides prerequisites (API keys) and examples, but does not explicitly state when to use this tool versus alternatives like get_llm_cost_by_model or get_llm_costs. Implicitly it's for Langfuse users, but no explicit when-not or direct comparisons.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chaandannn/finopsmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server