Skip to main content
Glama

Last Price

draw_session_spend

Right before you pay for one call in a session open_spend_session opened, draw the call's price from it. drawn true: pay for the call now. An error means do not pay for this call: the draws would pass the session's maximum (remaining says what is left), this one call costs more than the policy allows per purchase, your owner changed the policy and the session was closed (open a new one if it still allows), or the session is closed or expired. If the call then fails, settle_session_draw with outcome failed gives the draw back. 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
itemNoOptional: what this call buys.
noteNoOptional: a request or payment reference.
amountYesThis call's price, in the session's currency.
pay_toNoThe account this call pays, when open_spend_session named pay_to (then required). Another account is refused with code payee_changed: do not pay; the session stays open.
session_idYesreservation.id from open_spend_session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / pay_to
      Added value: +{
      +  "description": "The account this call pays, when open_spend_session named pay_to (then required). Another account is refused with code payee_changed: do not pay; the session stays open.",
      +  "maxLength": 200,
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. Added

TDQS

A4.3/5.0
Behavior4/5

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

Well beyond the annotations: it discloses auth requirements (Last Price credential with price compute scope), a workspace-claim gate that returns 403, the meaning of failure responses, and the refund path via settle_session_draw. It stops short of describing the success payload shape (only hinting at a 'drawn' flag) and does not warn against re-issuing a draw after a partial success, which matters given idempotentHint=false.

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-loaded with the trigger condition before the error catalogue, and every clause carries a decision the agent must make. It is dense to the point of being a run-on sentence, but no sentence is expendable.

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 non-idempotent state-mutating tool with no output schema, it covers the sequencing, the four failure modes, the credential and workspace prerequisites, and the recovery path. The remaining gap is the success response contract and double-draw behavior, which an agent must guess at.

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% and the schema already documents session_id, amount, pay_to, item and note in detail, including the payee_changed code. The description adds only incremental context around pay_to's refusal semantics, so the baseline of 3 applies.

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 specific verb and resource ('draw the call's price' from a session) and pins the exact moment in the lifecycle ('right before you pay for one call'). It implicitly and clearly separates itself from open_spend_session, settle_session_draw and close_spend_session by naming the surrounding steps.

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

Usage Guidelines5/5

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

Explicit when-to-use ('right before you pay for one call in a session open_spend_session opened'), explicit follow-up alternative ('If the call then fails, settle_session_draw with outcome failed gives the draw back'), and explicit when-not ('an error means do not pay for this call'). The four refusal reasons each carry a prescribed remediation.

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