Skip to main content
Glama

rag_cost

Read-only

What a RAG / document-search set-up costs in embeddings and reranking: pages of documents and tokens per page embedded once, the percent changed and re-embedded each month, queries a day embedded, and passages reranked per query - at the cheapest listed seller of every embedding and rerank model, USD, 30 days. The answer LLM is not included (use agent_cost / estimate_cost). Rows have card_url and cite.

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": "rag_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNorows per table, 25 by default
pagesNopages of documents, default 10000
queriesNoqueries a day, default 1000
change_pctNopercent re-embedded a month, default 10
doc_tokensNotokens per passage, default 400
rerank_docsNopassages reranked per query, 0 = no rerank, default 20
query_tokensNotokens per query, default 30
tokens_per_pageNodefault 600

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Beyond readOnlyHint=true, the description discloses the pricing basis (cheapest listed seller of every embedding and rerank model), the currency (USD), the window (30 days), and the row-level fields card_url and cite. That is real behavioral context an agent cannot get from the annotations, though return shape/pagination are only lightly touched.

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 what is priced, then the cost drivers, then the exclusion — a sensible order with no filler sentences. The long em-dash chain is dense and takes a second pass to parse, which keeps it from a 5.

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?

With no output schema, the description still names the returned row fields (card_url, cite) and the pricing assumption, which is the right load-bearing detail for a cost calculator. It stops short of describing the table's cost columns or how many rows appear, leaving a small gap for a tool with 8 inputs and no output 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 100%, so a 3 is the floor, and the description earns above it by giving semantic meaning: pages are embedded once, change_pct is the share re-embedded monthly, rerank_docs is passages reranked per query. It reinforces the cost model in prose rather than merely restating parameter names.

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 precise computed artifact: the cost of a RAG / document-search setup in embeddings and reranking, broken down into the exact drivers (pages, tokens per page, monthly churn, daily queries, reranked passages). It also scopes out the answer LLM and names the siblings that cover it, so an agent can tell it apart from agent_cost / estimate_cost without opening a schema.

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?

Explicitly says the answer LLM is out of scope and routes that case to agent_cost / estimate_cost, which is a clear alternative with a stated condition. It does not spell out when to prefer this over building a general estimate via estimate_cost, so it falls short of full when/when-not coverage.

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