Purchase tool credits
commerce.purchase_creditsVerify an x402 payment and credit an agent with per-use tool credits, enabling paid MCP tool calls after confirming payment requirements or legacy signatures.
Instructions
Verify an x402 payment and add per-use tool credits to the agent. MCP-native: call without payment for x402 requirements, then retry with _meta['x402/payment']. Legacy: PAYMENT-SIGNATURE + PAYMENT-REQUIRED after commerce.credits_requirements.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "commerce.purchase_credits"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| credits | No | Credit pack size that was purchased. Must match the requirements call. | |
| agent_id | No | Agent identity to credit. | |
| payment_required | No | Legacy PAYMENT-REQUIRED from commerce.credits_requirements. | |
| payment_signature | No | Legacy PAYMENT-SIGNATURE. Omit for MCP x402/payment transport. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |