Skip to main content
Glama

Preview a promo code

apply_promo
Read-onlyIdempotent

Validate a promo code (eligibility preview only — does NOT reserve a slot). Returns valid=true with discount info when the code is currently redeemable; pass the same code as place_order.promo_code to actually apply + redeem it (the slot is consumed only when the order lands).

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": {
      "agent_session_id": "<agent_session_id>",
      "code": "<code>"
    },
    "name": "apply_promo"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
agent_session_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, but the description adds genuinely new behavioral facts: no slot is reserved, the slot is consumed only when the order lands, and the success shape is valid=true plus discount info. It does not cover failure cases (e.g. invalid vs. expired vs. not-yet-active codes) or the auth/session requirement behind agent_session_id, which keeps it just 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?

Two tight sentences, with the critical caveat ('eligibility preview only — does NOT reserve a slot') front-loaded in parentheses before the mechanics. No filler; only minor cost is the parenthetical nesting, which is still easy to parse.

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, the description correctly supplies the return contract (valid=true with discount info), and the side-effect model is fully explained. The remaining gap is the unexplained agent_session_id and unspecified error/edge-case responses, minor for a simple two-param read-only tool.

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 0%, so the description must carry parameter meaning. It gives useful semantics for 'code' (it is the redeemable identifier, and the same value is reused as place_order.promo_code), but says nothing about agent_session_id, leaving one of two required params undocumented anywhere.

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 description states a specific verb and resource (validate a promo code / eligibility preview) and immediately disambiguates the misleading tool name 'apply_promo' by clarifying it does NOT apply or reserve anything. It names place_order.promo_code as the real application path, so an agent can distinguish it from siblings 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use and when-not-to-use guidance: call this to preview eligibility, then pass the same code to place_order.promo_code to actually redeem it. It also states the negative condition ('does NOT reserve a slot'), which is exactly the alternative-selection signal an agent needs.

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