Skip to main content
Glama

update_customer

Update an existing customer's details including name, email, phone, business information, locale, currency, tax exemption, and status using their customer ID.

Instructions

Update an existing customer. PUT /customers/{customerId}. Required: customerId. Optional: firstName, lastName, email, businessName, locale, phoneNum, phoneExt, preferredCurrency, taxExempt, status (active|disabled|archived).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customerIdYesCustomer ID to update (required)
firstNameNoCustomer first name
lastNameNoCustomer last name
emailNoCustomer email
businessNameNoBusiness name
localeNoLocale code
phoneNumNoPhone number
phoneExtNoPhone extension
preferredCurrencyNoPreferred currency code
taxExemptNoWhether customer is tax exempt
statusNoCustomer status: active, disabled, or archived

Implementation Reference

  • Handler function that validates input with Zod schema, extracts customerId, and delegates to customerService.updateCustomer.
    async function handler(client: Client, args: Record<string, unknown> | undefined) {
      const parsed = schema.safeParse(args);
      if (!parsed.success) {
        return errorResult(parsed.error.errors.map((e) => `${e.path.join(".")}: ${e.message}`).join("; "));
      }
      const { customerId, ...rest } = parsed.data;
      return handleToolCall(() => customerService.updateCustomer(client, customerId, rest));
    }
  • Zod schema for input validation of update_customer: requires customerId, optional firstName, lastName, email, businessName, locale, phoneNum, phoneExt, preferredCurrency, taxExempt, status.
    const schema = z.object({
      customerId: z.string().min(1, "customerId is required"),
      firstName: z.string().min(1).optional(),
      lastName: z.string().min(1).optional(),
      email: z.string().email().optional(),
      businessName: z.string().optional(),
      locale: z.string().optional(),
      phoneNum: z.string().optional(),
      phoneExt: z.string().optional(),
      preferredCurrency: z.string().optional(),
      taxExempt: z.boolean().optional(),
      status: z.enum(["active", "disabled", "archived"]).optional(),
    });
  • Exported Tool object combining the definition and handler, named updateCustomerTool.
    export const updateCustomerTool: Tool = {
      definition,
      handler,
    };
  • registerCustomerTools() returns an array of all customer tools including updateCustomerTool for registration.
    export function registerCustomerTools(): Tool[] {
      return [
        listCustomersTool,
        getCustomerTool,
        createCustomerTool,
        updateCustomerTool,
  • Service-layer updateCustomer function that strips undefined fields from body and performs PUT /customers/{customerId}.
    export async function updateCustomer(
      client: Client,
      customerId: string,
      body: UpdateCustomerBody
    ): Promise<Customer> {
      const payload = Object.fromEntries(
        Object.entries(body).filter(([, v]) => v !== undefined)
      ) as UpdateCustomerBody;
      return client.put<Customer>(
        `/customers/${customerId}`,
        Object.keys(payload).length ? payload : undefined
      );
    }
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavior. It only states 'Update' and the HTTP method, lacking details on permissions, side effects, or response format. For a mutation tool, this is insufficient.

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?

Three concise, well-structured sentences: action, HTTP method/endpoint, and parameter list. No unnecessary words, and the most critical information (purpose) is front-loaded.

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

Completeness3/5

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

While the schema is fully covered, the description lacks context about validation, error scenarios, or response. Given the tool's complexity and many siblings, more context would be beneficial.

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 the description adds little beyond repeating required/optional fields. It does explicitly list allowed status values, which adds slight value over the schema's description.

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 'Update an existing customer' and specifies the HTTP method and endpoint, making the action unambiguous. It distinguishes itself from siblings like create_customer and delete_customer.

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 description lists required and optional parameters but does not provide guidance on when to use this tool versus alternatives, such as when a customer already exists or what to do if the customer ID is invalid.

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/rhinosaas/rebillia-mcp-server'

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