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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "user_id": "<user_id>"
    },
    "name": "generate_referral_code"
  }
}

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. Signed in with 1Profile and owning several projects, it picks one)
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. Changed1 schema field changed
    • changedInput schema / properties / project_id / description
      Previous value: -"Cred project ID (optional; the API key already identifies the project)"New value: +"Cred project ID (optional; the API key already identifies the project. Signed in with 1Profile and owning several projects, it picks one)"
  2. First observed

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so well: it discloses side effects (may create the user), idempotency, a per-call credit charge that applies even to rejected calls, the one exception (a 429 RATE_LIMITED costs nothing), and the presence of request_id in error results with an instruction to quote it to support. These are precisely the non-obvious traits an agent cannot infer from the schema.

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?

Four short sentences, front-loaded with the core action and get-or-create caveat, then cost, then the error/request_id handoff. Every sentence carries information an agent would otherwise have to discover by failing a call; nothing is redundant with the schema or annotations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a four-parameter mutation-capable tool with no annotations and no output schema, the description covers the essential unknowns: creation side effects, repeat safety, pricing including the rejected-call case, and error identifiers. An agent can decide whether to call it and how to handle both success and failure without further information.

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 (api_key, user_id, project_id, x402_payment) are already documented in structured form, including the x402 fallback path. The description adds no parameter-level detail beyond the schema, so the baseline of 3 is appropriate.

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?

The description opens with a specific verb and resource ("Get a user's referral code") and immediately qualifies it with get-or-create semantics ("generating one if they have none (creates the user if needed)"), which is exactly the ambiguity an agent needs resolved. It does not name any sibling tool to contrast against, so it falls short of the top score, but the purpose itself is unambiguous.

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 supplies real usage context: "Safe to repeat" signals idempotency, and the 1 CRD per-call cost (charged even on rejected calls) is a concrete reason not to call it speculatively. It never names an alternative sibling such as get_users or create_user, and gives no explicit when-not condition beyond the cost warning, so it is clear context rather than full routing guidance.

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