Skip to main content
Glama

purchase_book

Complete a paid purchase of a book. This is a TERMINAL ACTION: it creates an order, charges the buyer, and grants a permanent entitlement. Only call this when the user has EXPLICITLY requested to buy. Never call as part of browsing, price comparison, or information gathering — prices are already visible in search_books results, and free previews are available via get_book_preview. If the user says 'don't buy', 'just compare', 'just tell me the price', or similar — do NOT call this tool. If the user requests an action that requires owning a book they don't own (e.g. commenting on an unowned book), do NOT silently purchase it on their behalf. Instead, tell the user the purchase requirement and ask them to confirm. Spending money is never an inferred default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoOPTIONAL. The buyer's api_key (from create_account). Pass it here only if it was NOT already set as the connection's Authorization header — e.g. an agent that just created an account in this same session and cannot reconfigure the connection. When set, it overrides the connect-time credential.
book_idYesThe book ID to purchase
versionNoSpecific version to purchase. Defaults to latest.
payment_tokenNoA Stripe Shared Payment Token (SPT) authorizing this charge via the Agentic Commerce Protocol. When provided, the purchase settles immediately and the response includes a download URL — no browser checkout needed. Omit it to receive a checkout_url for a human to complete payment in a browser.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full transparency burden and does so thoroughly. It discloses the terminal consequences: 'creates an order, charges the buyer, and grants a permanent entitlement', and adds a strict policy: 'Spending money is never an inferred default.' This informs the agent about irreversibility, financial impact, and consent requirements beyond what schema alone conveys.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, then immediately explains the consequences and usage rules. Despite being lengthy, every sentence serves a purpose: preventing unintended purchases, clarifying boundaries, and providing explicit alternatives. The structure is logical and efficient for a high-stakes tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Even without an output schema, the description provides all essential context: the action is terminal, requires explicit consent, creates an order/charge/entitlement, and includes guidance for indirect purchase situations. Combined with the fully documented input schema, the agent has sufficient information to invoke the tool correctly and avoid misuse.

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 baselines apply. The description does not add any parameter-specific meaning beyond the schema; it focuses entirely on usage policy and behavior. The schema already documents each parameter fully, so the description's lack of parameter detail does not create a gap, but there is no added value either.

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 opens with 'Complete a paid purchase of a book' — a specific verb and resource that immediately identifies the tool's function. It further distinguishes itself from siblings by explicitly stating prices are already visible in search_books and free previews are available via get_book_preview, clarifying the boundary between purchasing and browsing.

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?

The description gives explicit when-to-use and when-not-to-use guidance: 'Only call this when the user has EXPLICITLY requested to buy' and provides concrete examples like 'don't buy', 'just compare', and 'just tell me the price' where the tool must not be called. It also explains how to handle indirect purchase requirements (asking for confirmation) and names alternatives (search_books, get_book_preview).

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