Skip to main content
Glama

Cost of one session

session_cost

Retrieves the total US-dollar cost of every recorded LLM call in a session, split by token type for precise cost tracking.

Instructions

Total cost in US dollars of every recorded call in a session, split by token type.

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": {
      "session_id": "<session_id>"
    },
    "name": "session_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
session_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose the aggregation scope ('every recorded call') and the output shape (total in USD, split by token type), which implies a read-only lookup. It says nothing about behavior for an unknown or empty session_id, permissions needed to read a session's cost, or whether costs are recomputed versus cached.

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?

A single well-formed sentence with the resource and currency stated up front and the breakdown detail trailing. Nothing is padded, though it is terse enough that a clause about usage or the returned unit structure would have been worth the space.

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 a one-parameter read tool with no output schema, the description adequately conveys what comes back (total cost in USD, per-token-type split). The remaining gap is error/empty-session behavior and how it differs from cost_report, which is minor for a tool this simple.

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 0%, but there is only one required parameter whose name (session_id) is self-explanatory, and the description implicitly frames it as the session whose calls are priced. It adds no format, example, or validity constraints beyond what the bare schema conveys.

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?

The description names a specific resource and aggregation (total USD cost of every recorded call in a session) and scope (split by token type). It is clear what the tool returns, though it never contrasts itself with the sibling cost_report, so an agent must infer that this is the per-session variant.

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

Usage Guidelines2/5

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

There is no explicit when-to-use, when-not-to-use, or alternative routing. An agent can guess this applies when it needs one session's cost, but nothing in the text distinguishes it from cost_report or states prerequisites such as needing a valid recorded session.

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