Skip to main content
Glama
gate

gatepay-local-mcp

by gate

x402_sign_payment

Parse X402 payment requirements from the PAYMENT-REQUIRED header or response body, create a signed payment authorization, and submit it to complete a 402-protected HTTP request.

Instructions

Parse X402 payment requirements from PAYMENT-REQUIRED header or response body, create a signed payment authorization, and submit the payment to complete a 402-protected request. Supports signing modes: local_private_key (local EVM wallet), quick_wallet (custodial MCP wallet), and plugin_wallet (browser extension wallet). For centralized payment (中心化支付), obtain Gate Pay access_token via x402_gate_pay_auth and use x402_submit_payment with sign_mode centralized_payment — no MCP calls for Gate Pay auth. Provide either payment_required_header or response_body containing X402 payment requirements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesTarget URL for the payment request
bodyNoJSON string request body (optional)
methodNoHTTP method for the request
sign_modeNoOptional preferred signing mode. Omit to auto-select the highest-priority ready mode.
response_bodyNoOptional: Response body from 402 response, used for parsing payment requirements if PAYMENT-REQUIRED header is not available
wallet_login_providerNoWhen quick_wallet needs login: google = Google account, gate = Gate account. Defaults to gate.
payment_required_headerNoBase64-encoded PAYMENT-REQUIRED header value from a 402 response
Behavior4/5

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

With no annotations, the description carries the full burden and discloses the complete workflow: parsing, signing, and submission. It explicitly notes that Gate Pay auth is not performed via MCP calls, a useful behavioral constraint. It does not detail potential side effects like actual fund transfer or failure modes, but the payment intent is clear.

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?

Four sentences, front-loaded with the main action. It efficiently covers purpose, signing modes, and an important exception for centralized payment. The inclusion of the Chinese phrase is slightly redundant but not harmful.

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?

The description covers the main workflow, input alternatives, and mode selection. It omits return value details, but with no output schema, some ambiguity remains. Overall, for a complex tool with 7 parameters, it is reasonably complete.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds meaning by explaining that payment_required_header and response_body are alternative inputs and by clarifying the wallet types for sign_mode (local EVM wallet, custodial MCP wallet, browser extension wallet), which goes beyond the schema's brief descriptions.

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 clearly states the tool parses X402 payment requirements, creates a signed payment, and submits it to complete a 402-protected request. It lists specific signing modes, distinguishing it from siblings like x402_submit_payment, which is referenced for centralized payments.

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?

The description explicitly instructs that for centralized payment (中心化支付), users should obtain a Gate Pay access token via x402_gate_pay_auth and use x402_submit_payment instead, providing a clear alternative. It also specifies the two input sources (payment_required_header or response_body) and when to use each.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gate/gatepay-local-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server