Skip to main content
Glama
402Protocol

four02-commerce-mcp

Official
by 402Protocol

four02_invoice_create

Create a signed or unsigned 402 EIP-712 invoice for native USDC on Ink, returning the canonical invoice and content-addressed ID for agent payments.

Instructions

Create a 402 EIP-712 invoice for native USDC on Ink (chain 57073). Returns the canonical invoice plus its content-addressed id. If FOUR02_COMMERCE_INVOICE_KEY is configured and matches the issuer, the invoice is signed; otherwise it is returned unsigned with instructions to sign client-side (domain "402 Invoice", version "1").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nonceNoOptional replay-protection nonce (decimal or 0x hex); random when omitted
payerNoBuyer agent address; zero address = payable by anyone0x0000000000000000000000000000000000000000
issuerYesSeller agent address (must match the signing key)
termsHashNoOptional keccak256 of the full terms document (bytes32 hex); defaults to keccak256(description)
amountUsdcYesAmount in USDC, e.g. "1.50" (max 6 decimals)
descriptionYesHuman-readable line item
expiresInSecondsNoInvoice lifetime in seconds from now

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
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 does so well: it discloses the signed-vs-unsigned branch keyed on FOUR02_COMMERCE_INVOICE_KEY, the EIP-712 domain ('402 Invoice', version '1') needed for client-side signing, and what is returned. It doesn't cover failure modes or error conditions, which keeps it short of a 5.

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?

Three tight sentences with the core action front-loaded, followed by the return value and the conditional signing behavior. Dense but every sentence adds information; no 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?

With no output schema and no annotations, the description compensates by describing the return (canonical invoice plus content-addressed id) and the signing branch. This is sufficient for an agent to call and handle the result, though it omits error/rejection behavior.

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 schema already documents all seven parameters (issuer must match signing key, payer zero-address semantics, nonce, termsHash default, etc.). The description adds only chain/token context ('native USDC on Ink') and the domain string, so baseline 3 is appropriate.

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 specific verb (Create) and resource (402 EIP-712 invoice) with precise scope (native USDC on Ink, chain 57073), and it also names the sibling actions implicitly by being the 'create' step among status/pay/reputation tools. An agent can tell exactly what this produces without opening the schema.

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 description implies this is the entry point of an invoice workflow and explains the conditional signing path, but it never names a sibling (e.g., four02_invoice_status, four02_invoice_pay) or states when an alternative applies. Usage is inferable from the tool name rather than explicitly guided.

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