Skip to main content
Glama

Validate a discount code

insumer_validate_code
Read-onlyIdempotent

Validate INSR-XXXXX discount codes during ACP/UCP checkout: confirm validity, discount percent, and expiry. Returns status, reason, and walletProven without requiring auth or credits.

Instructions

Validate an INSR-XXXXX discount code. For merchant backends during ACP/UCP checkout to confirm code validity, discount percent, and expiry. Returns valid/invalid status with reason, and walletProven (whether the code went to a caller that proved control of the wallet). No authentication required, no credits consumed. Does not expose wallet or token data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesDiscount code in INSR-XXXXX format

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNotrue when the API call succeeded
dataNoThe endpoint's payload: a signed attestation, trust profile, discount, merchant or token records
keysNoJWKS entries (insumer_jwks)
metaNoResponse metadata such as version and timestamp
errorNoError details when ok is false
itemsNoThe result when the endpoint returns a JSON array
messageNoA plain-text result (insumer_setup), or a message from the API

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.16.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "data": {
      +      "description": "The endpoint's payload: a signed attestation, trust profile, discount, merchant or token records"
      +    },
      +    "error": {
      +      "description": "Error details when ok is false"
      +    },
      +    "items": {
      +      "description": "The result when the endpoint returns a JSON array",
      +      "items": {},
      +      "type": "array"
      +    },
      +    "keys": {
      +      "description": "JWKS entries (insumer_jwks)",
      +      "items": {},
      +      "type": "array"
      +    },
      +    "message": {
      +      "description": "A plain-text result (insumer_setup), or a message from the API"
      +    },
      +    "meta": {
      +      "description": "Response metadata such as version and timestamp"
      +    },
      +    "ok": {
      +      "description": "true when the API call succeeded",
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Addedv0.1.0

TDQS

A4.5/5.0
Behavior5/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 significant context beyond them: no authentication required, no credits consumed, return shape (valid/invalid with reason, walletProven), and a data privacy guarantee ('Does not expose wallet or token data'). This is a rich behavioral disclosure that goes well beyond the annotations.

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 sentences, front-loaded with the core action and followed by context, return info, and constraints. Every sentence adds value with no waste.

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?

Despite having an output schema, the description still summarizes the return values (valid/invalid status, reason, walletProven), which helps the agent understand the outcome. It covers authentication, cost, side effects, and privacy. Complete for a validation tool with one parameter and annotations.

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 coverage is 100% and the schema documents the single parameter with a pattern and description. The description mentions the INSR-XXXXX format, which is redundant with the schema, and adds no extra semantic detail about the parameter beyond what is already provided. Baseline 3 is appropriate.

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 (Validate) and resource (INSR-XXXXX discount code), and explicitly scopes it to merchant backends during ACP/UCP checkout. This distinguishes it from siblings like insumer_check_discount or insumer_attest by naming the exact format and use context.

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?

Clearly states the context ('For merchant backends during ACP/UCP checkout') and the purpose ('confirm code validity, discount percent, and expiry'). This tells when to use it, though it does not explicitly name an alternative tool (e.g., insumer_check_discount) or state when NOT to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.