Skip to main content
Glama

generate_referral_code

Get a user's referral code, generating one if they have none (creates the user if needed). Safe to repeat. Costs 1 CRD (platform credit) per call, charged even when the call is then rejected (a 429 RATE_LIMITED costs nothing). Error results include request_id; quote it to support.

Input Schema

NameRequiredDescriptionDefault
api_keyNoCred API key (optional if set via the x-api-key header)
user_idYesExternal user ID
project_idNoCred project ID (optional; the API key already identifies the project)
x402_paymentNoBase64 x402 PaymentPayload, only when a previous call failed with an x402 PaymentRequired because the account is out of CRD

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior5/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 richly: it discloses the 1 CRD cost per call, that the charge applies even on rejection, that a 429 RATE_LIMITED is free, that the call is repeatable, that it may create a user, and that errors carry a request_id to quote to support. This is exactly the behavioral context an agent needs before invoking.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences, front-loaded with the core action, then cost, then error handling. Every clause adds decision-relevant information with 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?

For a tool with no output schema and no annotations, the description covers cost, idempotency, side effects, and error handling well. It stops short of describing the return payload shape beyond 'referral code' and doesn't restate auth requirements, leaving a small gap.

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 all four parameters are already documented, and the description adds essentially no per-parameter meaning beyond the implicit 'creates the user if needed' hint tied to user_id. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear verb+resource ('Get a user's referral code') with an important qualifier that it generates one when absent and creates the user if needed. That get-or-create semantics differentiates it well from siblings like apply_referral or list_referrals, though it never explicitly names an alternative.

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?

Usage is implied rather than stated: 'Safe to repeat' signals idempotency and the cost note implies a use-with-care posture, but there is no explicit when-to-use vs when-not guidance or named alternative such as list_referrals for viewing existing codes.

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.

Resources