Skip to main content
Glama

Pre-authorize future subscription periods (Base)

shop.subscription.preauthorize
Destructive

Store 1..12 pre-signed USDC authorizations (EIP-3009 TransferWithAuthorization, signed with viem signTypedData) for the FUTURE periods of a Base subscription you pay for, so the platform pulls each period when it starts. Each authorization is for one period: from = the wallet that paid the subscription, to = the merchant payout wallet, value = the plan price in micro-USDC (when the platform fee is on, value = price - fee plus a second fee_authorization to the fee wallet for the fee; without it the fee is invoiced to the merchant), validAfter = the unix start of the period, validBefore 1 h to 72 h after it, a fresh nonce. The whole call is refused (422, nothing stored) if any item does not match. Nothing is debited early; cancel with shop.subscription.cancel (stored authorizations are never executed after it) or on-chain with cancelAuthorization(authorizer, nonce, signature) on the USDC contract. Status active or past_due, Base only; another identity's subscription is 404.

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": {
      "subscription_id": "<subscription_id>",
      "authorizations": "<authorizations>"
    },
    "name": "shop.subscription.preauthorize"
  }
}

Input Schema

NameRequiredDescriptionDefault
authorizationsYes
subscription_idYes

Output Schema

NameRequiredDescriptionDefault
pull_modeYes
renewal_keyNo
subscription_idYes
preauthorized_periodsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / renewal_key
      Added value: +{
      +  "type": "string"
      +}
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the destructiveHint/openWorldHint annotations: it discloses atomic all-or-nothing validation (422, nothing stored), that funds are not pulled until each period starts, the exact value math with and without the platform fee, the validBefore window of 1h–72h, and nonce freshness. The 'destructiveHint: true' annotation is consistent with storing authorizations that later debit the wallet, and the description makes that future-debit mechanism explicit rather than hiding it.

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 resource and cardinality, then the field-by-field construction, then constraints and cancellation. The parenthetical fee clause and parenthesized cancel note make one sentence dense and slightly run-on, but no sentence is filler.

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 high-complexity nested-payload mutation with an output schema, it covers atomicity, error codes, fee handling, and cancellation semantics. Minor gaps remain: nothing is said about re-submitting authorizations for periods already pre-authorized, and no caller/auth prerequisite beyond subscription ownership is stated.

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

Parameters5/5

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

With schema description coverage at 0%, the description fully compensates by defining every nested authorization field semantically: from is the paying wallet, to is the merchant payout wallet, value is micro-USDC (price minus fee, with a separate fee_authorization to the fee wallet), validAfter is the period start in unix time, validBefore its window, plus a fresh nonce. period_no's implicit 'future periods' meaning and the 1..12 bound are also conveyed, so an agent can construct the array without guessing.

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 precise verb and resource: store 1..12 pre-signed USDC EIP-3009 TransferWithAuthorization signatures for future periods of a Base subscription. It names the exact signature scheme (viem signTypedData), the chain (Base), and the actor ('a subscription you pay for'), leaving no ambiguity about what is created versus what a sibling like shop.subscription.confirm_pull might do.

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?

Gives clear preconditions — status must be active or past_due, Base only, another identity's subscription returns 404 — and routes the undo path to shop.subscription.cancel plus an on-chain cancelAuthorization alternative. It stops short of explicitly contrasting with other payment routes (e.g., paying a single period up front), so the when-not guidance is present but not exhaustive.

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.