Skip to main content
Glama

jsonhouse for Agents

Calculate LLM API cost

jsonhouse_calculate_pricing
Read-only

Estimate monthly LLM API cost per model from jsonhouse's weekly official-price snapshot, including cache reads, cache writes, long-context and regional multipliers, and tokenizer inflation where the snapshot records them. Call this when choosing a model, before writing a model ID into code or config, or when sizing a token budget. Prices are official list prices, not measured bills.

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": {
      "input_tokens": "<input_tokens>",
      "output_tokens": "<output_tokens>"
    },
    "name": "jsonhouse_calculate_pricing"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoCheapest N models to return (default 10)
regionNoAPI region, e.g. us (default global)
providersNoOnly these providers
cache_ratioNoShare of input served from cache (default 0)
cache_writesNoMonthly tokens written to cache (default 0)
input_tokensYesMonthly input tokens
output_tokensYesMonthly output tokens
prompt_lengthNoTypical prompt length in tokens (default 4096)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true and openWorldHint=false, so the description carries a lower burden. It still adds important behavioral context: costs come from a weekly official-price snapshot, include cache/long-context/regional/tokenizer adjustments where recorded, and represent list prices rather than measured bills.

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 definition is two sentences and front-loads the core action and data source. The list of included multipliers is dense but relevant; no sentence is wasted, though it could be slightly tighter.

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 an eight-parameter, read-only estimation tool with no output schema, the description is nearly complete: it explains the data source, the cost factors, and the list-price caveat. It could say more about the returned per-model ranking or fields, but the essential context is present.

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

Parameters3/5

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

Schema description coverage is 100%, so the input schema already documents all eight parameters in detail. The description mentions the conceptual cost factors (cache reads/writes, long-context, regional multipliers, tokenizer inflation) but does not add parameter-level syntax or defaults beyond what the schema supplies.

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?

The description states a specific verb and resource: 'Estimate monthly LLM API cost per model' from jsonhouse's weekly official-price snapshot. It immediately distinguishes the tool from sibling alert/query tools by naming the pricing snapshot and the exact cost components included.

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?

It gives clear when-to-use guidance: choosing a model, before writing a model ID into code/config, or sizing a token budget. It lacks explicit when-not-to-use guidance or named alternatives, but the intended contexts are stated concretely.

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