Skip to main content
Glama

Alterar quantidade

update_cart_item

Define a quantidade de um item do carrinho (0 remove o item). 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>",
      "codigo": "<codigo>",
      "quantidade": "<quantidade>"
    },
    "name": "update_cart_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
opcaoNoOpção do produto (cor, modelo), exatamente como em get_product.opcoes. Vazio se não houver.
codigoYesCódigo do produto (ex.: M10469).
quantidadeYes
session_tokenYesO session_token devolvido por start_session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Beyond the annotations, the description discloses two behaviors the annotations do not: that quantity 0 deletes the line, and that the updated cart is returned. This matters because destructiveHint=false might otherwise lead an agent to assume no deletion is possible, so the explicit disclosure is valuable, though it could be sharper about the removal implication.

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?

Two short sentences with the primary action and the important edge case front-loaded, then the return value. Nothing is redundant or padded.

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 states the return (updated cart), and it covers the critical quantity semantics for a 4-parameter tool. It stops short of describing failure modes (unknown codigo, missing session) or whether the item must already exist, which would fully close the gap.

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 75% (opcao, codigo and session_token documented; quantidade has only min/max bounds). The description compensates by defining the key semantic of quantidade — 0 means removal and 99 is the schema ceiling — which the bare integer constraint does not convey.

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 ("Define a quantidade") and resource ("item do carrinho") plus the return ("o carrinho atualizado"). The parenthetical that quantity 0 removes the item distinguishes it usefully from a pure removal tool, though it never names remove_cart_item or add_to_cart 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 only implied: the agent can infer this is the tool to change an existing item's quantity, and the "0 removes" note hints at its overlap with remove_cart_item. There is no explicit when-to-use or when-not-to-use guidance versus add_to_cart or remove_cart_item, and no statement about what happens if the item is not yet in the cart.

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