Skip to main content
Glama

check_code

Read-onlyIdempotent

Check one specific code: status (verified/declared/stale/dead/unknown_code), structured constraints, success stats, and — if a cart is supplied — whether it would apply.

Input Schema

NameRequiredDescriptionDefault
cartNoOptional cart context — when supplied, the answer includes whether the code would apply to this cart
codeYesThe promo code to check, exactly as a shopper would enter it at checkout
merchantYesMerchant slug, e.g. 'nike'

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / cart / description
      Added value: +"Optional cart context — when supplied, the answer includes whether the code would apply to this cart"
    • addedInput schema / properties / cart / properties / currency / description
      Added value: +"Currency code for cart.total, e.g. 'USD'"
    • addedInput schema / properties / cart / properties / customer_type / description
      Added value: +"Shopper type: 'any' (default), 'new' or 'returning' — some codes are new-customer only"
    • addedInput schema / properties / code / description
      Added value: +"The promo code to check, exactly as a shopper would enter it at checkout"
    • addedInput schema / properties / merchant / description
      Added value: +"Merchant slug, e.g. 'nike'"
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered. The description adds real behavioral context beyond that: the finite set of possible statuses including 'unknown_code', that success stats are returned, and the conditional behavior when a cart is supplied. It stops short of covering failure modes for an unrecognized merchant or any rate-limit/coverage caveats.

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?

One sentence, front-loaded with the verb and resource, then the return surface, with the conditional cart behavior placed last where it belongs. No filler, no restatement of the tool name.

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 usefully enumerates the return surface (status, constraints, stats, cart verdict), which is the main completeness gap it needed to close for a 3-parameter tool with a nested cart object. Minor gaps remain around behavior for an unknown merchant or partial cart data (e.g., cart without geo or currency).

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 100%, so the baseline is 3; the description earns an extra point by explaining the semantic effect of the optional cart parameter — supplying it changes the answer to include whether the code would apply to that cart. That is meaning beyond the schema's own 'optional cart context' phrasing.

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 and resource ('Check one specific code') and enumerates exactly what comes back: status with its enum values, structured constraints, success stats, and cart applicability. The 'one specific code' scope implicitly and clearly separates it from the sibling find_codes (a search) and report_outcome (a write-back).

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: an agent can infer this is the single-code lookup to run when a shopper presents a code, and that supplying a cart triggers an applicability answer. However, it never explicitly says when to use this versus find_codes, nor does it state prerequisites such as merchant slug format requirements beyond the schema.

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