Skip to main content
Glama

Check Code

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.

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": {
      "merchant": "<merchant>",
      "code": "<code>"
    },
    "name": "check_code"
  }
}

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. Changed2 schema fields changed
    • changedInput schema / properties / cart / properties / items / description
      Previous value: -"Optional line items (name, category, price, quantity) for cart-precise matching"New value: +"Optional line items for cart-precise matching; each item may carry its category and price"
    • addedInput schema / properties / cart / properties / items / items / properties
      Added value: +{
      +  "category": {
      +    "description": "Line item category, e.g. 'shoes'",
      +    "type": "string"
      +  },
      +  "price": {
      +    "description": "Line item price in the merchant's currency",
      +    "type": "number"
      +  }
      +}
  2. 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'"
  3. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is fully covered. The description adds useful behavioral detail by naming the status vocabulary (verified/declared/stale/dead/unknown_code) and tying cart presence to a richer answer, but says nothing about failure modes, merchant-not-found handling, or stat freshness.

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?

A single front-loaded sentence with zero filler: the resource, its scope, and the enumerated outputs come first, with the conditional cart behavior set off by an em dash. Nothing is repeated and nothing could be cut without losing information.

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 carries the return-value burden and does so reasonably by listing status values, constraints, success stats, and conditional applicability. The main residual gap is that 'structured constraints' and 'success stats' are not characterized (shape or units), which leaves an agent guessing at what the payload contains.

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%, including nested cart fields (geo, items, total, currency, categories, customer_type), so the baseline is 3. The description's note about cart-supplied applicability restates what the cart property description already says, adding no new semantics such as how matching treats partial carts or whether constraints are evaluated strictly.

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?

Uses a specific verb (check) with a tightly scoped resource ('one specific code') and enumerates what is returned: status with its five possible values, structured constraints, success stats, and optional cart applicability. The 'one specific code' phrasing implicitly contrasts with the plural find_codes sibling, but no sibling is named, so differentiation is inferential rather than explicit.

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: call this when you already have a single code and want its status/stats, and supply a cart only if you need an applicability answer. There is no explicit 'use find_codes instead when you do not yet know the code' statement and no mention of report_outcome, leaving the agent to infer routing among siblings.

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