Skip to main content
Glama

Last Price

close_spend_session

Close a session when its run of calls is done, once: what you drew counts as spent, and returned says how much of the maximum went back to today's cap. Close as soon as you are done rather than letting it lapse, so the rest of the budget is free for other purchases at once. Needs a Last Price credential with price compute scope. Needs a claimed workspace: a sandbox key from self-registration is refused (403) until a person claims the workspace.

Input Schema

NameRequiredDescriptionDefault
noteNoOptional: why the run ended.
session_idYesreservation.id from open_spend_session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the settlement side effect (drawn counts as spent, remainder returns to cap), the single-use nature ("once", consistent with idempotentHint=false), and the two hard preconditions: a Last Price credential with price compute scope and a claimed workspace, with the specific 403 on sandbox keys. This is the kind of precondition detail an agent cannot get from the schema.

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?

Purpose is front-loaded in the first clause, with effects and then prerequisites following in logical order. Slightly padded — "rather than letting it lapse, so the rest of the budget is free for other purchases at once" restates the same incentive twice — but no sentence is wasted.

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 correctly explains the return value (how much of the maximum went back to the cap) and covers auth and workspace preconditions for a mutation call. It omits what happens on a double close or an expired session, a minor gap for a non-idempotent mutation.

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 coverage is 100%, so session_id (reservation.id from open_spend_session) and the optional note are already documented. The description adds no further parameter-level detail such as format or constraints, so the baseline 3 applies.

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?

Specific verb+resource ("Close a session") with the exact effect spelled out: drawn amounts count as spent and unused budget returns to today's cap. Clear enough for an agent to understand it, but it never distinguishes this from the sibling settle_session_draw, which sounds functionally adjacent.

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?

Explicit timing guidance: close once the run of calls is done, and close promptly rather than letting the session lapse so budget frees immediately. No exclusion or alternative tool is named, so the agent gets a clear when but no when-not.

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