Skip to main content
Glama

cadastrar_cliente

Register a new customer in the system by providing mandatory CPF and name, plus optional details and address.

Instructions

Cadastra um novo cliente no sistema. O campo CPF é obrigatório. Se o usuário não fornecer, solicite um CPF (pode ser um gerado para testes).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nomeYes
cpfYes
infoYes
enderecoNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:11-18 (handler)
    The MCP tool handler for 'cadastrar_cliente'. Decorated with @mcp.tool(), it accepts nome, cpf, info, and optional endereco, and delegates to database.salvar_novo() to insert a new client record.
    @mcp.tool()
    def cadastrar_cliente(nome: str, cpf: str, info: str, endereco: str = "") -> str:
        """
        Cadastra um novo cliente no sistema. 
        O campo CPF é obrigatório. Se o usuário não fornecer, solicite um CPF 
        (pode ser um gerado para testes).
        """
        return database.salvar_novo("clientes", nome=nome, cpf=cpf, info=info, endereco=endereco)
  • server.py:11-12 (registration)
    Tool registration via @mcp.tool() decorator. The FastMCP instance 'mcp' (defined on line 6) registers 'cadastrar_cliente' as an MCP tool by virtue of this decorator annotation.
    @mcp.tool()
    def cadastrar_cliente(nome: str, cpf: str, info: str, endereco: str = "") -> str:
  • The function signature defines the input schema: nome (str), cpf (str), info (str), and optional endereco (str, defaults to empty). The return type is str.
    def cadastrar_cliente(nome: str, cpf: str, info: str, endereco: str = "") -> str:
        """
        Cadastra um novo cliente no sistema. 
        O campo CPF é obrigatório. Se o usuário não fornecer, solicite um CPF 
        (pode ser um gerado para testes).
        """
        return database.salvar_novo("clientes", nome=nome, cpf=cpf, info=info, endereco=endereco)
  • The database.salvar_novo() helper function that inserts a row into the specified table using keyword arguments as column/value pairs.
    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?

With no annotations, the description must fully disclose behavior. It reveals the tool creates a client and that CPF is required, but lacks information on side effects (e.g., duplicates), permissions, rate limits, or what constitutes a successful registration. This is insufficient for safe autonomous use.

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 description is two sentences and 38 words, which is concise. The first sentence states the core purpose, and the second provides critical usage guidance. It is front-loaded and efficient, though the structure could be slightly improved by integrating the CPF note more naturally.

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 the tool has 4 parameters and an output schema (which is not referenced), the description is too sparse. It does not explain return values, error handling, or constraints like duplicate CPF. For a registration tool, more context (e.g., what confirms success) is needed.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It only clarifies the 'cpf' parameter (mandatory, testable). No details are provided for 'nome', 'info', or 'endereco', leaving the agent to infer their purpose from names alone.

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 description clearly states 'Cadastra um novo cliente no sistema' which identifies the action (register) and resource (new client). While it doesn't explicitly differentiate from sibling tools like 'editar_cliente', the verb and context are distinct enough. The mandatory CPF note adds clarity.

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 provides explicit guidance: CPF is mandatory and instructs the agent to request it if missing, even suggesting a test CPF. This is practical usage advice, though it doesn't specify when to avoid using the tool relative to alternatives.

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