Skip to main content
Glama
nilsond
by nilsond

Vestuário MCP

GitHub repo size GitHub language count GitHub forks GitHub open issues GitHub open pull requests

Python 3.11+ MCP SDK 2.3.0 License MIT

Servidor MCP em memória que simula o backend de um e-commerce de roupas: catálogo, carrinho com reserva de estoque e pedidos. Feito com o MCP Python SDK v2 (mcp==2.3.0), em que o antigo FastMCP agora se chama MCPServer.

⚠️ Segurança: o modo HTTP não tem autenticação. Qualquer pessoa com a URL do ngrok pode chamar as tools. Encerre o túnel ao terminar.

💻 Pré-requisitos

Antes de começar, verifique se você tem:

  • Python >= 3.11.

  • pip >= 25.1 (necessário para a opção --group).

  • Opcional: Node.js (para o MCP Inspector), ngrok e uv.

Related MCP server: Commerce MCP Server

🚀 Instalando

Clone o repositório e entre na pasta:

git clone https://github.com/nilsond/guilda-inovacao-criando-mcp.git
cd guilda-inovacao-criando-mcp

Com venv + pip (é o que a configuração do Kiro abaixo usa):

python3 -m venv .venv && .venv/bin/pip install -e . --group dev

Ou, como alternativa, com uv:

uv sync

Com uv, troque .venv/bin/python por uv run nos comandos abaixo.

☕ Usando

O servidor expõe:

Tipo

Nome

O que faz

Tool

listar_produtos(categoria?)

Lista o catálogo, com filtro opcional (Camisetas, Calças, Casacos, Acessórios, Calçados)

Tool

buscar_produto_por_id(produto_id)

Todos os detalhes de um produto

Tool

verificar_estoque(produto_id, tamanho)

Estoque físico, reservado e disponível

Tool

adicionar_ao_carrinho(session_id, produto_id, quantidade, tamanho)

Adiciona ao carrinho e reserva o estoque

Tool

remover_do_carrinho(session_id, produto_id, tamanho, quantidade?)

Remove o item e devolve a reserva

Tool

ver_carrinho(session_id)

Itens, subtotais e total em BRL

Tool

finalizar_pedido(session_id, endereco_entrega)

Cria o pedido, baixa o estoque e limpa o carrinho

Resource

ecommerce://politica-trocas

Política de trocas e devoluções (Markdown)

Prompt

recomendar_look(ocasiao, estilo?)

Consultor de estilo que monta looks com peças do catálogo

Estoque por tamanho: disponível = estoque físico − reservado.

Erros de negócio (produto inexistente, tamanho inválido, estoque insuficiente etc.) voltam como resultado com is_error=true e uma mensagem em PT-BR, para o LLM conseguir se corrigir.

MCP Inspector via STDIO

npx @modelcontextprotocol/inspector .venv/bin/python server_mcp.py   # com uv: uv run mcp dev server_mcp.py

O Inspector abre no navegador. Explore as abas Tools, Resources e Prompts. O mcp dev do SDK chama o uv por baixo, então sem uv use o npx direto.

HTTP local

.venv/bin/python server_mcp.py --transport http           # http://127.0.0.1:8000/mcp
npx @modelcontextprotocol/inspector                       # em outro terminal

No Inspector, escolha Streamable HTTP e use a URL http://127.0.0.1:8000/mcp.

Remoto via ngrok

ngrok http 8000                                            # anote o host, ex.: abc123.ngrok-free.app
.venv/bin/python server_mcp.py --transport http --public-host abc123.ngrok-free.app

No Inspector, conecte em https://abc123.ngrok-free.app/mcp.

O --public-host (ou a variável PUBLIC_HOST) é obrigatório nesse cenário. O SDK ativa uma proteção contra DNS rebinding que responde 421 Invalid Host header para qualquer host fora da allowlist, e o ngrok repassa o host público.

Kiro

Local (STDIO): crie o arquivo .kiro/settings/mcp.json no workspace com o conteúdo abaixo, trocando /caminho/para/guilda-inovacao-criando-mcp pelo caminho onde você clonou o repositório. O servidor aparece no painel MCP do Kiro; se precisar, reconecte por esse painel. autoApprove está vazio, então cada chamada de tool pede confirmação.

{
  "mcpServers": {
    "vestuario-mcp": {
      "command": "/caminho/para/guilda-inovacao-criando-mcp/.venv/bin/python",
      "args": ["/caminho/para/guilda-inovacao-criando-mcp/server_mcp.py"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

Com uv, a entrada fica assim:

"vestuario-mcp": {
  "command": "uv",
  "args": ["--directory", "/caminho/para/guilda-inovacao-criando-mcp", "run", "server_mcp.py"]
}

Remoto (ngrok): o Kiro aceita servidores remotos pelo campo url (documentação de configuração, anúncio de remote MCP). Com o túnel e o servidor HTTP no ar, adicione:

"vestuario-mcp-remoto": {
  "url": "https://abc123.ngrok-free.app/mcp"
}

Se o cliente não conectar, use a ponte mcp-remote:

"vestuario-mcp-remoto": {
  "command": "npx",
  "args": ["-y", "mcp-remote", "https://abc123.ngrok-free.app/mcp"]
}

Exemplos de uso

Com o servidor conectado ao Kiro (ou a outro cliente MCP), experimente:

  1. "Quais casacos vocês têm e quanto custam?"

  2. "Monte um look casual para um happy hour" (ou use o prompt recomendar_look)

  3. "Adicione o look ao carrinho da sessão demo, tamanho M"

  4. "Mostre o estoque da jaqueta no tamanho M" (a reserva aparece)

  5. "Qual é a política de trocas?" (resource)

  6. "Finalize o pedido para Av. Paulista, 1000 - Bela Vista, São Paulo/SP"

O estado vive na memória e é zerado sempre que o servidor reinicia.

Exemplo mínimo

examples/hello.py é um servidor MCP com uma única tool (somar), comentado linha a linha. Bom ponto de partida para entender o MCPServer antes de olhar o projeto completo:

npx @modelcontextprotocol/inspector .venv/bin/python examples/hello.py

Guias

🧪 Testes

.venv/bin/python -m pytest        # ou: uv run pytest
.venv/bin/python -m pytest -q     # saída resumida

Os testes cobrem as regras de negócio (inclusive concorrência pela última unidade), as tools, o resource e o prompt via cliente MCP em memória, o servidor HTTP real com o bloqueio/liberação do host do ngrok, a CLI e o exemplo examples/hello.py.

📁 Estrutura do projeto

.
├── server_mcp.py              # CLI: --transport stdio|http, --host, --port, --public-host
├── src/vestuario_mcp/
│   ├── __init__.py            # exporta build_server e Loja
│   ├── models.py              # tipos e modelos Pydantic (viram structured output)
│   ├── data.py                # catálogo mock (11 produtos) e política de trocas
│   ├── services.py            # regras de negócio (classe Loja, com lock)
│   └── server.py              # build_server(): tools, resource e prompt
├── tests/                     # pytest: serviços, MCP em memória, CLI/HTTP e exemplos
├── examples/
│   └── hello.py               # servidor MCP mínimo
├── docs/
│   ├── 01-criando-o-servidor.md
│   ├── 02-expondo-com-ngrok.md
│   └── 03-conectando-clientes.md
├── pyproject.toml
├── LICENSE
└── README.md

📫 Contribuindo

Para contribuir com o projeto, siga estas etapas:

  1. Bifurque este repositório.

  2. Crie um branch: git checkout -b <nome_branch>.

  3. Faça suas alterações e confirme-as: git commit -m '<mensagem_commit>'

  4. Envie para o branch original: git push origin <nome_branch>

  5. Crie a solicitação de pull.

Como alternativa, consulte a documentação do GitHub em como criar uma solicitação pull.

🤝 Colaboradores

📝 Licença

Este projeto está sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.

Available Tools

7 tools
adicionar_ao_carrinhoA

Adiciona um item ao carrinho do cliente e RESERVA as unidades no estoque.

A reserva diminui a disponibilidade para outros clientes até o pedido ser finalizado ou o item ser removido. Adicionar de novo o mesmo produto e tamanho soma as quantidades.

Args: session_id: identificador do carrinho do cliente. produto_id: ID do produto. quantidade: unidades a adicionar (> 0). tamanho: P, M, G ou GG.

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

Erros: Produto não encontrado; tamanho inválido ou indisponível para o produto; quantidade <= 0; estoque insuficiente (a mensagem informa quantas unidades estão disponíveis).

NameRequiredDescriptionDefault
tamanhoYesTamanho da peça: P, M, G ou GG.
produto_idYesID numérico do produto, obtido em listar_produtos.
quantidadeYesQuantidade de unidades, inteiro maior que zero.
session_idYesIdentificador do carrinho do cliente, ex.: 'demo'. Use o mesmo valor em toda a compra.

Output Schema

NameRequiredDescription
carrinhoYes
mensagemYes

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (non-readOnly, non-idempotent), it discloses the real consequence: reserved units reduce availability for other customers until checkout or removal. The re-add accumulation rule crisply explains why the call is not idempotent, and the error list names the insufficient-stock failure with the number of available units returned.

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?

The first sentence front-loads the action and its side effect; the Args/Returns/Erros blocks are scannable and each line carries information. Slightly long for a four-parameter tool, and the Returns block is partly redundant with the output schema.

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?

Covers what the call does, its side effect on shared stock, the accumulation rule, and every documented failure mode with what the error message contains. With an output schema present, the brief Returns line is sufficient rather than a 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 100%, so the baseline is 3; the description earns one more by tying parameters to behavior — quantidade must be > 0, tamanho restricted to P/M/G/GG, and the same produto_id+tamanho pair merges into an existing line rather than creating a new one, which changes how an agent should call it repeatedly.

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 and resource ('Adiciona um item ao carrinho') plus the side effect ('RESERVA as unidades no estoque'), and the sibling set makes the add-vs-remove distinction obvious. An agent can tell immediately this is the cart-write path, not a read like ver_carrinho or verificar_estoque.

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?

Explains the operational consequence of reserving stock and that the same product+size accumulates quantity, and implies reversal via 'até o pedido ser finalizado ou o item ser removido'. It does not explicitly point at verificar_estoque as a pre-check or name remover_do_carrinho as the undo path, so a small inference remains.

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

buscar_produto_por_idA
Read-onlyIdempotent

Retorna todos os detalhes de um produto: descrição, cores, tamanhos, preço e disponibilidade por tamanho.

Args: produto_id: ID do produto, obtido em listar_produtos.

Returns: Detalhes do produto, incluindo disponivel_por_tamanho (estoque físico menos reservas).

Erros: Produto não encontrado. A mensagem lista os IDs existentes.

NameRequiredDescriptionDefault
produto_idYesID numérico do produto, obtido em listar_produtos.

Output Schema

NameRequiredDescription
idYesIdentificador do produto.
nomeYes
coresYes
precoYesPreço unitário em BRL.
tamanhosYes
categoriaYes
descricaoYes
preco_formatadoYesPreço formatado, ex.: R$ 79,90.
disponivel_totalYesUnidades disponíveis somando todos os tamanhos.
disponivel_por_tamanhoYesUnidades disponíveis (estoque físico menos reservas) por tamanho.

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare this as read-only, idempotent, non-destructive and closed-world, so the description only needs to add behavior beyond that. It contributes real value by documenting the error path ('Produto não encontrado. A mensagem lista os IDs existentes') and by explaining that `disponivel_por_tamanho` is physical stock minus reservations, a non-obvious business rule.

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-line purpose followed by short Args/Returns/Erros blocks — easy to scan and no wasted prose. The Args section is near-redundant with the schema, which slightly dilutes it, but the structure remains efficient.

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 single-parameter lookup with full annotations and an output schema, the description covers the essentials: what is returned, where the ID comes from, and how failure behaves. The only gap is guidance on preferring verificar_estoque when only stock is needed.

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 single parameter is fully described in the schema, so the baseline is 3. The description's 'ID do produto, obtido em listar_produtos' restates the schema text verbatim rather than adding format or constraint detail.

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 ('Retorna todos os detalhes de um produto') and enumerates what details are included (descrição, cores, tamanhos, preço, disponibilidade por tamanho). This clearly separates it from listar_produtos, which only lists. It does not explicitly address the overlap with verificar_estoque, which also reports availability.

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?

The description gives concrete usage context by telling the agent where the required ID comes from ('obtido em listar_produtos'), which chains it correctly after the listing tool. It lacks an explicit exclusion rule against verificar_estoque for stock-only lookups, so it is clear context but not full when/when-not guidance.

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

finalizar_pedidoA

Finaliza a compra: converte o carrinho em pedido, baixa o estoque e limpa o carrinho.

Confirme o carrinho com o cliente (ver_carrinho) antes de chamar esta tool.

Args: session_id: identificador do carrinho do cliente. endereco_entrega: endereço completo de entrega.

Returns: Pedido confirmado com número, itens, total, endereço e data/hora.

Erros: Carrinho vazio; endereço vazio ou incompleto.

NameRequiredDescriptionDefault
session_idYesIdentificador do carrinho do cliente, ex.: 'demo'. Use o mesmo valor em toda a compra.
endereco_entregaYesEndereço completo: rua, número, bairro, cidade/UF e CEP.

Output Schema

NameRequiredDescription
idYes
itensYes
totalYes
statusYes
criado_emYesData/hora de criação em ISO 8601 (UTC).
session_idYes
total_formatadoYes
endereco_entregaYes
quantidade_itensYes

TDQS

A4.3/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing concrete side effects: the cart is converted, stock is decremented, and the cart is cleared, plus a list of error conditions. What is missing is an explicit statement that the operation is not idempotent and cannot be undone/replayed, which matters for a checkout finalizer with idempotentHint=false and destructiveHint=false.

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 summary sentence, then prerequisite, then Args/Returns/Erros sections — easy to scan. The Args block is somewhat redundant given full schema coverage, which keeps it from a 5.

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 mutating checkout tool it covers the essential ground: side effects, prerequisite confirmation step, return payload contents, and failure modes. The gaps are non-idempotency/duplicate-order behavior and what state the cart is left in on partial failure, so it stops short of fully complete.

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%, so both parameters are already documented in the input schema, including the 'use o mesmo valor em toda a compra' note for session_id and the address component breakdown. The Args section in the description largely restates that, adding no format or validation detail beyond the schema; baseline 3 applies.

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 and resource ('Finaliza a compra: converte o carrinho em pedido') plus the side effects (baixa estoque, limpa carrinho), which distinguishes it from siblings like ver_carrinho or adicionar_ao_carrinho. An agent can identify this as the terminal checkout action without reading the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent to the sibling 'ver_carrinho' and states the precondition of confirming the cart with the customer before calling. It also enumerates the blocking conditions (carrinho vazio, endereço vazio/incompleto), which doubles as a when-not-to-call signal.

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

listar_produtosA
Read-onlyIdempotent

Lista os produtos do catálogo da loja Vestuário MCP.

Use esta tool para descobrir o que existe à venda antes de recomendar ou adicionar itens. Para cada produto vêm: id, nome, categoria, preço em BRL, tamanhos vendidos, cores e unidades disponíveis somando todos os tamanhos.

Args: categoria: filtro opcional por categoria. Não diferencia maiúsculas nem acentos ("calcas" também funciona).

Returns: Objeto com o filtro aplicado, o total de produtos e a lista de produtos.

Erros: Categoria inexistente. A mensagem lista as categorias válidas.

NameRequiredDescriptionDefault
categoriaNoFiltro opcional: Camisetas, Calças, Casacos, Acessórios ou Calçados. Omita para listar tudo.

Output Schema

NameRequiredDescription
totalYes
produtosYes
categoria_filtroYesCategoria aplicada como filtro, se houver.

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, closed-world behavior, so the bar is lower, and the description adds real context: the exact fields returned, summation across sizes, and the error case where an invalid category lists valid ones. It doesn't mention pagination or result-size limits, which would matter for a catalog listing.

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 purpose sentence followed by usage, then structured Args/Returns/Erros sections. There is mild overlap with the schema on the category list, but the extra semantics justify the length.

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?

An output schema exists, yet the description still summarizes the returned fields and the total count, and it documents the error path. Combined with full parameter coverage and annotations, an agent has everything needed to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 adds behavior the schema lacks: the filter is case- and accent-insensitive ('calcas' also works). That is genuinely useful matching semantics an agent could not infer from the anyOf string type.

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 and resource ('Lista os produtos do catálogo'), names the store, and implies its role versus the id-based and stock siblings. An agent can distinguish this from buscar_produto_por_id or verificar_estoque without opening any schema.

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?

Explicitly says when to use it: 'descobrir o que existe à venda antes de recomendar ou adicionar itens', which ties it to the recommendation and cart flows. It stops short of naming an alternative tool or stating 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.

remover_do_carrinhoA

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.

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

NameRequiredDescription
carrinhoYes
mensagemYes

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.

ver_carrinhoA
Read-onlyIdempotent

Exibe o conteúdo atual do carrinho de um cliente e calcula o valor total.

Args: session_id: identificador do carrinho do cliente.

Returns: Itens com preço unitário e subtotal, quantidade total de unidades e total em BRL. Uma sessão sem itens devolve carrinho vazio (total R$ 0,00).

NameRequiredDescriptionDefault
session_idYesIdentificador do carrinho do cliente, ex.: 'demo'. Use o mesmo valor em toda a compra.

Output Schema

NameRequiredDescription
itensYes
totalYes
session_idYes
total_formatadoYes
quantidade_itensYesTotal de unidades no carrinho.

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive behavior. The description adds useful behavioral detail that an empty session returns an empty cart with total R$ 0,00 and that totals are calculated, without contradicting annotations.

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?

Purpose is front-loaded and the Args/Returns structure is easy to scan. The Args section largely repeats a fully documented schema field, though the Returns section earns its place by adding empty-cart behavior.

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?

This is a simple single-parameter read tool with rich annotations and an output schema. The description covers purpose, return shape, and the empty-cart edge case, so nothing critical is missing.

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 already documents session_id with an example and reuse instruction. The description only restates that it identifies the customer's cart, adding no new parameter semantics.

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, 'Exibe', and resource, 'conteúdo atual do carrinho', plus the total calculation. It is unmistakably the read-only cart-viewing sibling, distinct from add/remove/finalize tools, even without naming them.

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?

Implies use for inspecting a customer's current cart, but does not explicitly say when to choose it over siblings or state prerequisites. No exclusions or workflow guidance are given.

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

verificar_estoqueA
Read-onlyIdempotent

Consulta se há estoque disponível de um produto em um tamanho específico.

Mostra o estoque físico, quantas unidades estão reservadas em carrinhos e quantas ainda podem ser adicionadas (disponivel). Consulte antes de adicionar ao carrinho.

Args: produto_id: ID do produto. tamanho: P, M, G ou GG (aceita minúsculas).

Returns: Situação do estoque com em_estoque (bool) e uma mensagem legível.

Erros: Produto não encontrado; tamanho fora da grade ou não vendido para esse produto.

NameRequiredDescriptionDefault
tamanhoYesTamanho da peça: P, M, G ou GG.
produto_idYesID numérico do produto, obtido em listar_produtos.

Output Schema

NameRequiredDescription
nomeYes
tamanhoYes
mensagemYes
reservadoYesUnidades reservadas em carrinhos ainda não finalizados.
disponivelYes
em_estoqueYes
produto_idYes
estoque_fisicoYes

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so the safety profile is covered. The description goes further by explaining what the numbers mean (physical stock, reserved in carts, addable units) and by listing the error cases (product not found, size outside the grid). Return-value detail overlaps the existing output schema, which keeps this from a 5.

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 summary followed by Args/Returns/Erros sections is easy to scan and appropriately sized. The Returns block duplicates the output schema, so a sentence or two does not earn its place.

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?

For a two-parameter read-only lookup this covers purpose, pre-cart usage, accepted size inputs, and failure modes, while the output schema carries the return shape. An agent has everything needed to call it correctly.

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 both parameters are already documented, and the Args block largely restates them. The one genuine addition is "aceita minúsculas" for tamanho, a case-insensitivity rule the schema does not mention, which prevents a real invocation error.

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?

The first sentence names a specific verb (consulta) and resource (estoque disponível) scoped to a product and size, which is clearly distinct from sibling tools like listar_produtos and buscar_produto_por_id. It stops short of explicitly naming those siblings or stating what it is not, so it lands at clear-but-not-differentiated.

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?

"Consulte antes de adicionar ao carrinho" gives an explicit workflow trigger that ties it to the adicionar_ao_carrinho sibling. It states when to use it clearly but gives no when-not conditions or alternatives for other stock-related questions.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 7 tool updatesv0.1.0
    • First observedadicionar_ao_carrinho
    • First observedbuscar_produto_por_id
    • First observedfinalizar_pedido
    • First observedlistar_produtos
    • First observedremover_do_carrinho
    • First observedver_carrinho
    • First observedverificar_estoque

TDQS

A4.1/5.0

Scored across 7 tools

Disambiguation4/5

The tools cover distinct stages of a shopping flow, with clear boundaries between browsing, stock checking, cart operations, and checkout. The only mild overlap is between buscar_produto_por_id and verificar_estoque, since the former also returns availability per size, but the specific-size stock check remains clearly differentiated.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern in Portuguese: listar_produtos, buscar_produto_por_id, verificar_estoque, adicionar_ao_carrinho, remover_do_carrinho, ver_carrinho, and finalizar_pedido. There are no mixed conventions or ambiguous standalone verbs.

Tool Count5/5

Seven tools is well scoped for a clothing-store MCP server. Each tool maps to a necessary step in the browse-to-checkout workflow, and none appear redundant or extraneous.

Completeness4/5

The core customer workflow is fully covered: product listing, product detail, stock checking, cart add/remove/view, and order finalization. Minor gaps remain around post-purchase operations such as order history, order status lookup, or cancellation, which could be useful but do not block the primary flow.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers