Skip to main content
Glama

Pay with a card the user approves

writ_payment
Destructive

Pays on a site with one of the user's cards; card numbers never reach this conversation. request (site, max_amount, purpose) returns a tell_user and an open_url where the user approves; wait (grant_id or confirmation_id); checkout pauses at the order button for the user's confirmation, then Writ places the order; fill; list (card handles only). Details: writ_help('writ_payment').

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": {
      "action": "<action>"
    },
    "name": "writ_payment"
  }
}

Input Schema

NameRequiredDescriptionDefault
siteNorequest: the store's domain.
stepsNo
actionYesrequest | wait | checkout | fill | list.
fieldsNo
purposeNoOne line the user reads.
sessionNoThe browser session on the checkout page.
summaryNo
currencyNo
grant_idNo
max_amountNoThe most it may charge.
automation_idNo
total_selectorNo
commit_selectorNocheckout: the place-order button.
confirmation_idNo
payment_method_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / automation_id
      Added value: +{
      +  "type": "integer"
      +}
    • addedInput schema / properties / currency
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / fields
      Added value: +{
      +  "type": "object"
      +}
    • addedInput schema / properties / payment_method_id
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / steps
      Added value: +{
      +  "items": {
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / summary
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / total_selector
      Added value: +{
      +  "type": "string"
      +}
  2. Changed15 schema fields changed
    • changedInput schema / properties / action / description
      Previous value: -"request = the user approves a card for one purchase; wait = hold until they answer (grant_id) or until a checkout is settled (confirmation_id); checkout = pause at the order button for the user's confirmation, then Writ places the order; fill = type an approved virtual card early; list = the user's payment methods as handles."New value: +"request | wait | checkout | fill | list."
    • removedInput schema / properties / automation_id
      Removed value: -{
      -  "description": "request: the automation the card is for, when the purchase is a saved automation.",
      -  "type": "integer"
      -}
    • changedInput schema / properties / commit_selector / description
      Previous value: -"checkout (required): CSS selector of the button that places the order. Writ clicks it after the user confirms."New value: +"checkout: the place-order button."
    • removedInput schema / properties / confirmation_id / description
      Removed value: -"wait: the confirmation_id action='checkout' returned."
    • removedInput schema / properties / currency
      Removed value: -{
      -  "description": "request / checkout: the store's currency, three-letter ISO code ('eur', 'usd', 'gbp'); max_amount is in it. Omitted: the user's card currency on request, the currency the page total shows on checkout. A card pays only in its own currency.",
      -  "type": "string"
      -}
    • removedInput schema / properties / fields
      Removed value: -{
      -  "additionalProperties": {
      -    "oneOf": [
      -      {
      -        "type": "string"
      -      },
      -      {
      -        "properties": {
      -          "frame_url": {
      -            "type": "string"
      -          },
      -          "selector": {
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "selector"
      -        ],
      -        "type": "object"
      -      }
      -    ]
      -  },
      -  "description": "request, for live browsing: card field -> CSS selector on the checkout page (writ_browser_context reads them), or {selector, frame_url} for a field inside a payment provider's frame (frame_url = part of the frame's URL, e.g. 'js.stripe.com'). Keys: number, exp (MM/YY), exp_month, exp_year, exp_year2, cvc, name, zip. Writ types into exactly these.",
      -  "type": "object"
      -}
    • removedInput schema / properties / grant_id / description
      Removed value: -"wait / fill / checkout: the grant_id action='request' returned."
    • changedInput schema / properties / max_amount / description
      Previous value: -"request / checkout: the most this purchase may charge, tax and shipping included (e.g. 129.99). checkout without grant_id needs it."New value: +"The most it may charge."
    • removedInput schema / properties / payment_method_id
      Removed value: -{
      -  "description": "request: a handle id from action='list' to pre-select that card; the user still approves.",
      -  "type": "string"
      -}
    • changedInput schema / properties / purpose / description
      Previous value: -"request: one line the user reads when approving, e.g. 'Buy Nike Dunk Low, size 10'."New value: +"One line the user reads."
    • changedInput schema / properties / session / description
      Previous value: -"checkout / fill (required) / request: the session_id of the writ_browser_use session on the checkout page."New value: +"The browser session on the checkout page."
    • changedInput schema / properties / site / description
      Previous value: -"request: the store's domain, e.g. 'store.example.com'. The card is typed only on this site and its payment frames."New value: +"request: the store's domain."
    • removedInput schema / properties / steps
      Removed value: -{
      -  "description": "checkout: steps Writ runs after confirmation, before the order button, e.g. [{\"type\":\"fill_card\"}, {\"type\":\"click\",\"selector\":\"#continue\"}, {\"type\":\"wait\",\"seconds\":2}] for a card page followed by a review page. Default: fill the granted card, then the order button.",
      -  "items": {
      -    "type": "object"
      -  },
      -  "type": "array"
      -}
    • removedInput schema / properties / summary
      Removed value: -{
      -  "description": "checkout: one line the user reads when confirming, e.g. '1 x Nike Dunk Low, size 10, shipped to home'.",
      -  "type": "string"
      -}
    • removedInput schema / properties / total_selector
      Removed value: -{
      -  "description": "request / checkout: CSS selector of the order total on the checkout page. Writ reads it and never clicks on when it is above the maximum. Needed for an auto-confirm rule to apply.",
      -  "type": "string"
      -}
  3. First observed

TDQS

B3.3/5.0
Behavior4/5

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

Annotations already flag destructive, non-idempotent, open-world behavior, so the safety profile is covered. The description adds genuinely non-obvious facts: card numbers never reach the conversation, the user approves via a returned tell_user/open_url, and checkout pauses at the order button for a human confirmation before Writ places the order. It does not state whether a charged payment can be reversed or how long a grant_id stays valid.

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

Conciseness3/5

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

Front-loaded with the purpose, which is good, but the semicolon-separated action fragments read as notes rather than prose, and bare items like 'fill;' consume space without conveying anything. It is compact but sacrifices parseability for density.

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

Completeness3/5

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

For a destructive, multi-step payment flow with 15 parameters, a nested steps/fields object and no output schema, the description covers the critical flow and the shape of the request return value. It is still incomplete: the 'fill' action, the steps/fields payload, and the success/failure semantics of checkout are unaddressed, and the definition leans on writ_help to fill the gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 40% across 15 parameters, so the description must carry weight. It maps a few (site, max_amount, purpose on request; grant_id/confirmation_id on wait; card handles for list), but leaves steps, fields, session, summary, currency, automation_id, total_selector and payment_method_id entirely unexplained in both places.

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?

States a specific verb and resource (pays on a site with one of the user's cards) and names the human-approval mechanism, so the agent knows it is a card-payment tool rather than a generic browser action. It is clearly distinct from browser siblings in intent, though the telegraphic action list muddies the core statement.

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

Usage Guidelines3/5

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

The action names (request, wait, checkout, fill, list) plus their parameter hints imply a sequence and therefore when each mode applies. However there is no explicit statement of when to prefer this over writ_browser_act/writ_browser_use for a purchase, and 'fill' is listed with no explanation of when it is needed; it defers to writ_help for real guidance.

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.