Skip to main content
Glama

atualizar_endereco_direto

Update a customer's address by providing their CPF and full address text, when no postal code is available.

Instructions

Atualiza o endereço de um cliente informando o CPF e o texto do endereço por extenso (Rua, Número, Bairro, etc). Use esta ferramenta quando o usuário não quiser usar o CEP.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cpfYes
novo_enderecoYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:80-95 (handler)
    Handler function that implements the 'atualizar_endereco_direto' tool. It looks up a client by CPF, then directly updates their address with the provided text.
    @mcp.tool()
    def atualizar_endereco_direto(cpf: str, novo_endereco: str) -> str:
        """
        Atualiza o endereço de um cliente informando o CPF e o texto do endereço 
        por extenso (Rua, Número, Bairro, etc). Use esta ferramenta quando 
        o usuário não quiser usar o CEP.
        """
        
        clientes = database.buscar_registros("clientes", "cpf", cpf)
        
        if not clientes:
            return f"Cliente com CPF {cpf} não encontrado."
        
        id_cliente = clientes[0][0]
        
        return database.atualizar_registro("clientes", id_cliente, endereco=novo_endereco)
  • server.py:80-80 (registration)
    Registration of the tool via the @mcp.tool() decorator on the function.
    @mcp.tool()
  • Input schema: expects 'cpf' (str) and 'novo_endereco' (str), returns a string.
    def atualizar_endereco_direto(cpf: str, novo_endereco: str) -> str:
  • Helper function 'buscar_registros' used by the tool to find the client by CPF.
    def buscar_registros(tabela, campo_filtro=None, valor_filtro=None):
        conn = sqlite3.connect(DB_NAME)
        cursor = conn.cursor()
        if campo_filtro:
            cursor.execute(f"SELECT * FROM {tabela} WHERE {campo_filtro} LIKE ?", (f"%{valor_filtro}%",))
        else:
            cursor.execute(f"SELECT * FROM {tabela}")
        rows = cursor.fetchall()
        conn.close()
        return rows
  • Helper function 'atualizar_registro' used by the tool to persist the new address to the database.
    def atualizar_registro(tabela, registro_id, **kwargs):
        conn = sqlite3.connect(DB_NAME)
        cursor = conn.cursor()
        
        set_clause = ', '.join([f"{k} = ?" for k in kwargs.keys()])
        sql = f"UPDATE {tabela} SET {set_clause} WHERE id = ?"
        cursor.execute(sql, list(kwargs.values()) + [registro_id])
        conn.commit()
        conn.close()
        return f" {tabela.capitalize()} ID {registro_id} atualizado!"
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states that it updates an address, but does not disclose any side effects, authentication requirements, or behavior on errors (e.g., CPF not found). This lack of detail is a gap for a mutation tool.

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?

The description consists of two concise sentences. The first sentence explains the purpose, and the second provides usage guidance. There is no irrelevant information.

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?

Given the tool's simplicity (2 parameters, no nested objects) and the presence of an output schema (which handles return value documentation), the description is mostly complete. It covers purpose, when to use, and parameter semantics. It does not address error handling or edge cases, but that is acceptable for such a straightforward tool.

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?

The input schema has no descriptions (0% coverage). The description adds significant value by explaining that 'novo_endereco' should be the full address text including street, number, neighborhood, etc., which clarifies the expected format beyond the schema's parameter names.

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 the action (atualiza/update), the resource (endereço de um cliente/address of a client), and the required parameters (CPF and full address text). It also distinguishes itself from sibling tools by noting that it is used when the user does not want to use CEP.

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 explicitly says 'Use esta ferramenta quando o usuário não quiser usar o CEP', providing a clear context for when to use this tool over alternatives. However, it does not include when not to use or any prerequisites.

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