Skip to main content
Glama
nilsond
by nilsond

remover_do_carrinho

Remove an item or a specified quantity from a shopping cart and returns the reserved stock, keeping cart quantities and inventory updated.

Instructions

Remove um item do carrinho, inteiro ou em parte, e devolve a reserva ao estoque.

Args: session_id: identificador do carrinho do cliente. produto_id: ID do produto que está no carrinho. tamanho: tamanho do item no carrinho. quantidade: unidades a remover; se omitido, remove a linha inteira.

Returns: Mensagem de confirmação e o carrinho atualizado.

Erros: Item não está no carrinho; quantidade <= 0 ou maior que a quantidade no carrinho.

Input Schema

NameRequiredDescriptionDefault
tamanhoYesTamanho da peça: P, M, G ou GG.
produto_idYesID numérico do produto, obtido em listar_produtos.
quantidadeNoUnidades a remover. Omita para remover o item inteiro.
session_idYesIdentificador do carrinho do cliente, ex.: 'demo'. Use o mesmo valor em toda a compra.

Output Schema

NameRequiredDescriptionDefault
carrinhoYes
mensagemYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare the mutation profile (readOnly false, idempotent false, destructive false), and the description adds real value on top: the reservation is returned to stock, a confirmation plus updated cart comes back, and the specific error conditions are enumerated. Consistent with destructiveHint=false since stock is restored.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded one-sentence purpose followed by Args/Returns/Erros sections that are each short and skimmable. Minor redundancy with the schema's parameter descriptions, but nothing is 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?

An output schema exists so the Returns block is a bonus rather than a requirement, and the error taxonomy covers the realistic failure modes. For a 4-parameter mutation tool the definition leaves no significant ambiguity about inputs or outcomes.

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%, so all four parameters are already documented, and the Args block largely restates them. It does add the conditional behavior for 'quantidade' (omitted = remove the whole line) and the upper bound against the cart quantity, but that is only marginal beyond the schema.

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 (remove) and resource (item from cart) plus the scope qualifier 'inteiro ou em parte', and discloses the stock-restoration side effect. It is clearly the inverse of adicionar_ao_carrinho, though the description never names that sibling 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?

The omission rule for 'quantidade' implies when to do a full-line vs partial removal, and the Erros section bounds valid input. There is no explicit guidance on when to use this versus correcting the cart another way (e.g. ver_carrinho first, or reducing quantity vs deleting the line).

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