Skip to main content
Glama

cadastrar_produto

Add a new product to the inventory by providing name, price, and stock quantity.

Instructions

Cadastra um novo produto no inventário.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nomeYes
precoYes
estoqueYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler that registers a new product, accepting name, price, and stock, then delegates to database.salvar_novo.
    @mcp.tool()
    def cadastrar_produto(nome: str, preco: float, estoque: int) -> str:
        """Cadastra um novo produto no inventário."""
        return database.salvar_novo("produtos", nome=nome, preco=preco, estoque=estoque)
  • server.py:99-99 (registration)
    The @mcp.tool() decorator that registers 'cadastrar_produto' as an MCP tool.
    @mcp.tool()
  • The database helper function that inserts a new row into the specified table, called by cadastrar_produto.
    def salvar_novo(tabela, **kwargs):
        conn = sqlite3.connect(DB_NAME)
        cursor = conn.cursor()
        colunas = ', '.join(kwargs.keys())
        placeholders = ', '.join(['?'] * len(kwargs))
        sql = f"INSERT INTO {tabela} ({colunas}) VALUES ({placeholders})"
        cursor.execute(sql, list(kwargs.values()))
        conn.commit()
        conn.close()
        return f" {tabela.capitalize()} cadastrado com sucesso!"
Behavior2/5

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

No annotations are provided, and the description only states 'Cadastra', implying a creation action. It does not disclose behavioral traits such as whether duplicates are allowed, generated IDs, or post-creation state. The description carries the full burden but fails to provide it.

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

Conciseness3/5

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

The description is a single sentence with no extra words, but it is overly brief. Conciseness should not come at the cost of necessary information; a bit more detail would be acceptable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 3 required parameters, no annotations, and an output schema that is not referenced, the description is incomplete. It does not mention return values, error behavior, or any additional context needed for correct invocation.

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

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% (no descriptions in properties). The description does not explain any parameter meaning, default values, or constraints. For a 3-parameter tool with no schema descriptions, this is a critical gap.

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?

The description clearly states it registers a new product ('Cadastra um novo produto no inventário'). It distinguishes from sibling tools like editar_produto (edit) and remover_produto (remove), though not 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 purpose implicitly indicates creation, but there is no explicit guidance on when to use this tool versus alternatives (e.g., editar_produto). No when-not conditions or prerequisites are mentioned.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mateus-gondev/MCP-PIE'

If you have feedback or need assistance with the MCP directory API, please join our Discord server