Skip to main content
Glama

Create or Update Customer

createCustomer
Destructive

Create or Update Customer

Upsert a customer by contact identity. When both email and phone are sent, match email first; if no email match, fall through to phone (E.164, then raw). Email-only or phone-only keep that single-field match. Matched rows are updated; otherwise a customer is created. Returns 409 when email and phone match two different existing customers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityNoCity for the address.
emailNoEmail used for upsert matching. When both email and phone are provided, email is tried first; a match updates that customer. When only email is provided, match is by email only.
notesNoInternal notes about the customer.
phoneNoPhone used for upsert matching (E.164 when parseable, otherwise raw). When both email and phone are provided and email does not match, phone is tried next. When only phone is provided, match is by phone only.
stateNoState, province, or region for the address.
companyNoCompany or organization name associated with the customer.
address1NoPrimary street address line.
address2NoSecondary street address line, such as suite or apartment.
last_nameNoCustomer last name.
photo_urlNoPublic image URL downloaded and stored as the customer photo before the record is created. Returns 400 if the URL cannot be fetched or is not a valid image. Accepts at most 500 characters.
tag_slugsNoTag slugs to attach to the customer.
first_nameYesCustomer first name.
postal_codeNoPostal or ZIP code for the address.
signed_up_atNoWhen the customer signed up. Optional instant for request bodies: Unix timestamp as integer (seconds), or a date/time string of at most 50 characters that PHP Carbon can parse. For strings, ISO-8601 / RFC 3339 (for example 2026-04-28T15:30:00Z) is the recommended format in examples and client integrations. Invalid values fail validation. When the field is omitted or null, the API uses the current server time where that behavior is documented on the operation.
location_slugNoSlug of an existing project location. Returns 404 if the slug is not found.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoShort code or application-level status code for this resource.
dataNoResponse payload for the request.
successNoIndicates whether the request completed successfully.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / email / description
      Previous value: -"Email address for the person or customer."New value: +"Email used for upsert matching. When both email and phone are provided, email is tried first; a match updates that customer. When only email is provided, match is by email only."
    • changedInput schema / properties / phone / description
      Previous value: -"Phone number for the person or customer."New value: +"Phone used for upsert matching (E.164 when parseable, otherwise raw). When both email and phone are provided and email does not match, phone is tried next. When only phone is provided, match is by phone only."
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false, and openWorldHint=true, so the safety bar is lower. The description adds real value beyond them: it explains that matched rows are updated rather than created, and surfaces the 409 conflict when email and phone match two different customers. It does not disclose whether omitted fields are cleared on an update, which matters for a destructive 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?

Four short sentences, all load-bearing, with the upsert identity and match order front-loaded. No repetition of the title or schema boilerplate.

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?

With an output schema present, return values need no explanation, and the description covers matching, creation-vs-update, and the 409 path. The remaining gap is that a 15-parameter destructive upsert never says whether unspecified fields are nulled on an existing match.

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?

Schema description coverage is 100%, so the baseline is 3. The description goes further by synthesizing the cross-field matching precedence (email first, then phone E.164, then raw) into a single rule, which is exactly the interaction the per-field schema docs describe only in isolation.

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?

States a specific verb pair and resource ('Create or Update Customer' / 'Upsert a customer by contact identity') and immediately distinguishes itself from siblings like updateCustomer and getCustomer by framing the operation as an identity-matched upsert. An agent can tell what this does without opening the schema.

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?

Gives clear operational context: when both email and phone are sent, email is tried first and phone is the fallback; single-field inputs use only that field. It does not explicitly name an alternative tool (e.g., updateCustomer) or state when to prefer this over a direct update, so it stops short of full when/when-not guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources