Skip to main content
Glama

Aplicar cupom

apply_coupon

Aplica um cupom de desconto ao carrinho (as regras do cupom valem como no site). Cupom vazio remove o cupom aplicado. Devolve o carrinho atualizado.

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": {
      "session_token": "<session_token>",
      "cupom": "<cupom>"
    },
    "name": "apply_coupon"
  }
}

Input Schema

NameRequiredDescriptionDefault
cupomYesCódigo do cupom.
session_tokenYesO session_token devolvido por start_session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare a non-read-only, non-destructive mutation, and the description adds two useful traits: an empty coupon removes the currently applied one, and validation follows site rules (implying invalid codes can be rejected). It does not say how a rejection surfaces (error vs. cart state) or whether the previous coupon is lost on failure.

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 short sentences with the core action front-loaded, followed by the edge case and the return value. No filler or repetition of the title.

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?

For a two-parameter mutation with full schema coverage and no output schema, the description covers action, edge case, and return shape (updated cart). The only missing piece is error/invalid-coupon behavior, which matters for an agent that must decide whether to retry.

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 baseline is 3, but the description goes beyond it by defining the empty-string semantics of `cupom` — a value the schema permits (no minLength) and would otherwise be ambiguous. It does not add anything for `session_token`, which the schema already explains.

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?

States a specific verb and resource ("Aplica um cupom de desconto ao carrinho") and adds a scope caveat that coupon rules match the site. It is clearly distinguishable from cart-mutation siblings like add_to_cart or remove_cart_item, though it never names an alternative explicitly.

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 by the operation itself — you call it to attach a coupon to an existing cart — but there is no explicit when-to-use, no prerequisite (e.g. that a session and cart must already exist), and no guidance on when to call get_cart instead.

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