Skip to main content
Glama

Referral rail

wever_referral-rail
Destructive

Create a rail-signed WL-R-XXXXXX referral code, permanently attribute your own wallet with a signed code_token, inspect earnings, claim USDC, or verify a signed referral receipt. POST /api/referral-rail. Every call requires X-Wever-Wallet-Proof signed by the caller wallet and bound to the exact request body. Attribution requires the referee wallet proof, rejects self-referrals and permits only the first code. Earnings accrue from verified real payment and settlement records: 20 percent of eligible USDC paid for 12 months from the first attributed paid call. Claims reserve earnings and create a linked payout instruction for the authenticated referrer wallet, require a stable claim_id for retries, and allow 1.00 to 25.00 USDC per claim. Optional amount_usdc requests an exact amount within the available balance; omit it to claim the available balance up to 25 USDC. The treasury holder uses wever_payout-authorize and wever_payout-execute with AP2 holder binding v2 and separate EIP-712 spending consent. The dedicated payout wallet requires manual funding; the shared payout cap is 100 USDC per UTC day. Retry the original claim after execution to reconcile the confirmed transfer and obtain its receipt. Total outstanding accruals are capped at 200.00 USDC and fail closed beyond that cap. Attributions and confirmed payouts return record-backed, verifiable signed receipts. Paid URL: 0.10 USDC per call on Base mainnet using x402 exact, under the existing shared 10 signed-wallet free calls over rolling 30 days. The payout wallet does not receive API fees or escrow principal. Read the backend 402 body and /api/referral-contract for the exact contract and public verification key. This adapter forwards only caller-supplied credentials and grants no spending authority.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / oneOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "action": {
      -        "const": "create_code",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "action"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "action": {
      -        "const": "attribute",
      -        "type": "string"
      -      },
      -      "code": {
      -        "pattern": "^WL-R-[A-Z0-9]{6}$",
      -        "type": "string"
      -      },
      -      "code_token": {
      -        "maxLength": 4096,
      -        "minLength": 64,
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "action",
      -      "code",
      -      "code_token"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "action": {
      -        "const": "earnings",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "action"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "action": {
      -        "const": "claim",
      -        "type": "string"
      -      },
      -      "claim_id": {
      -        "pattern": "^[A-Za-z0-9:_-]{1,64}$",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "action",
      -      "claim_id"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "action": {
      -        "const": "verify_receipt",
      -        "type": "string"
      -      },
      -      "receipt": {
      -        "maxLength": 8192,
      -        "minLength": 64,
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "action",
      -      "receipt"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "action": {
      +        "const": "create_code",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "action"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "action": {
      +        "const": "attribute",
      +        "type": "string"
      +      },
      +      "code": {
      +        "pattern": "^WL-R-[A-Z0-9]{6}$",
      +        "type": "string"
      +      },
      +      "code_token": {
      +        "maxLength": 4096,
      +        "minLength": 64,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "action",
      +      "code",
      +      "code_token"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "action": {
      +        "const": "earnings",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "action"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "action": {
      +        "const": "claim",
      +        "type": "string"
      +      },
      +      "amount_usdc": {
      +        "pattern": "^(0|[1-9][0-9]{0,2})(\\.[0-9]{1,6})?$",
      +        "type": "string"
      +      },
      +      "claim_id": {
      +        "pattern": "^[A-Za-z0-9:_-]{1,64}$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "action",
      +      "claim_id"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "action": {
      +        "const": "verify_receipt",
      +        "type": "string"
      +      },
      +      "receipt": {
      +        "maxLength": 8192,
      +        "minLength": 64,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "action",
      +      "receipt"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only flag destructive/openWorld/non-idempotent; the description adds substantial behavioral detail beyond that: every call requires an X-Wever-Wallet-Proof bound to the exact request body, attribution rejects self-referrals and permits only the first code, claims reserve earnings and create a linked payout instruction, claim_id must be stable for retries, amounts are bounded 1.00–25.00 USDC, outstanding accruals cap at 200.00 USDC and fail closed, plus the shared 100 USDC/day payout cap and paid-URL pricing. That is exactly the kind of mutation/auth/limit context annotations cannot convey.

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?

The action list is front-loaded, which is good, but the remainder is a dense wall of long sentences mixing auth, economics, caps, retry semantics, and pricing without any structural separation. Every clause is informative, yet the sheer density and lack of chunking make it harder to scan than it needs to be.

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 multi-action payment tool with no output schema and a oneOf schema, the description covers authentication, action semantics, amount bounds, retry/reconciliation flow, caps, and where to find the full contract (402 body, /api/referral-contract). It is close to complete; minor gaps remain around what the earnings/receipt responses actually contain, though the signed-receipt guarantee is stated.

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 already 100%, so the baseline is 3, but the description adds real meaning: amount_usdc is optional and requests an exact amount within the available balance (omit to take the balance up to 25 USDC), and claim_id is required to be stable across retries. It also explains the role of code_token (signed, binds attribution) beyond the raw type/pattern constraints.

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 first sentence enumerates all five operations with specific verbs and resources (create rail-signed code, attribute wallet with code_token, inspect earnings, claim USDC, verify receipt), so an agent can map an intent to the correct action without opening the schema. It also names the sibling payout tools (wever_payout-authorize / wever_payout-execute) used by the treasury holder, differentiating itself from those.

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?

It gives concrete selection conditions: omit amount_usdc to claim the available balance, supply it for an exact amount within the available balance; retry the original claim after execution to reconcile; the treasury holder should use wever_payout-authorize/execute instead. It stops short of explicitly stating when NOT to use this tool versus other rails (e.g., subscription-rail, payout-create), so it is clear context without full exclusions.

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.