Skip to main content
Glama
norman-finance

Norman Finance MCP Server

Official

update_client

Modify client details in Norman Finance MCP Server, including name, type, address, contact info, and VAT number. Ensures accurate and up-to-date client records for accounting and tax processes.

Instructions

Update an existing client.

Args:
    client_id: ID of the client to update
    name: Updated client name
    client_type: Updated client type ("business" or "private")
    address: Updated client physical address
    zip_code: Updated client postal/zip code
    email: Updated client email address
    country: Updated client country code (e.g. "DE")
    vat_number: Updated client VAT number
    city: Updated client city
    phone: Updated client phone number
    
Returns:
    Updated client record

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressNo
cityNo
client_idYes
client_typeNo
countryNo
emailNo
nameNo
phoneNo
vat_numberNo
zip_codeNo

Implementation Reference

  • The main handler function for the 'update_client' tool. It updates an existing client by fetching current data, applying only the provided field updates, and sending a PATCH request to the Norman API.
    @mcp.tool()
    async def update_client(
        ctx: Context,
        client_id: str,
        name: Optional[str] = None,
        client_type: Optional[str] = None,
        address: Optional[str] = None,
        zip_code: Optional[str] = None,
        email: Optional[str] = None,
        country: Optional[str] = None,
        vat_number: Optional[str] = None,
        city: Optional[str] = None,
        phone: Optional[str] = None
    ) -> Dict[str, Any]:
        """
        Update an existing client.
        
        Args:
            client_id: ID of the client to update
            name: Updated client name
            client_type: Updated client type ("business" or "private")
            address: Updated client physical address
            zip_code: Updated client postal/zip code
            email: Updated client email address
            country: Updated client country code (e.g. "DE")
            vat_number: Updated client VAT number
            city: Updated client city
            phone: Updated client phone number
            
        Returns:
            Updated client record
        """
        api = ctx.request_context.lifespan_context["api"]
        company_id = api.company_id
        
        if not company_id:
            return {"error": "No company available. Please authenticate first."}
        
        if client_type and client_type not in ["business", "private"]:
            return {"error": "client_type must be either 'business' or 'private'"}
        
        client_url = urljoin(
            config.api_base_url, 
            f"api/v1/companies/{company_id}/clients/{client_id}/"
        )
        
        # Get current client data
        current_data = api._make_request("GET", client_url)
        
        # Update only provided fields
        update_data = {}
        if name:
            update_data["name"] = name
        if client_type:
            update_data["clientType"] = client_type
        if email:
            update_data["email"] = email
        if phone:
            update_data["phone"] = phone
        if vat_number:
            update_data["vatNumber"] = vat_number
        if address:
            update_data["address"] = address
        if zip_code:
            update_data["zipCode"] = zip_code
        if country:
            update_data["country"] = country
        if city:
            update_data["city"] = city
        
        # If no fields provided, return current data
        if not update_data:
            return {"message": "No fields provided for update.", "client": current_data}
        
        return api._make_request("PATCH", client_url, json_data=update_data)
  • Calls register_client_tools(server) which registers the update_client tool (along with other client tools) with the MCP server instance.
    register_client_tools(server)

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/norman-finance/norman-mcp-server'

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