Skip to main content
Glama

Upsert Customers

upsert_customers
DestructiveIdempotent

Create or update customers in the partner master (max 500 per call) — for customer lists that don't arrive via import_historical_sales_orders. Matched by email (case-insensitive) first, falling back to exact name — so a row with an email still converges onto an existing same-name partner and enriches it. Besides contact details a row can set vatIdNumber, customerSegment (individual | distributor | other) and a default taxRate. A match that is currently only a vendor is upgraded in place (enabled_customer) since partners are one entity with role flags. Preserve-on-omit updates; validateOnly=true dry-runs every row. An optional per-row customFields map (see list_custom_fields, entity=businessPartner) writes tenant-defined field values; an unknown fieldName fails just that row. Partial success with per-row errors; resubmitting is safe. Requires an operator (unpinned) org token — the partner master is tenant-shared.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "customers": "<customers>"
    },
    "name": "upsert_customers"
  }
}

Input Schema

NameRequiredDescriptionDefault
customersYesCustomer rows to create/update (max 500). name is required per row.
validateOnlyNotrue = dry-run: validate + probe every row and report the would-be action per row, writing nothing.

Output Schema

NameRequiredDescriptionDefault
rowsNo
totalNo
failedNo
createdNo
updatedNo
uomsCreatedNo
validateOnlyNo
enabledCustomersNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only supply the readOnly/destructive/idempotent/openWorld flags; the description goes much further, disclosing the match order (case-insensitive email, then exact name), the in-place vendor-to-enabled_customer upgrade, preserve-on-omit update semantics, per-row failure on unknown fieldName, partial success with per-row errors, and that resubmission is safe. The operator (unpinned) org-token requirement is exactly the kind of auth constraint annotations cannot express.

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?

Single dense paragraph that front-loads the action, cap and routing hint, then layers matching, field semantics, and failure behavior. Every sentence carries load, but the lack of structure makes it heavy to scan and a couple of clauses (idempotency, token requirement) are buried at the end.

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

Completeness5/5

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

For a bulk upsert with two top-level params and an output schema present, the description covers everything an agent needs: matching rules, partial-success and error behavior, dry-run, idempotency, auth scope, and cross-references to list_custom_fields. Return-value explanation is rightly omitted since an output schema exists.

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 coverage is 100% and the schema already carries descriptions for taxRate, customFields, customerSegment and vatIdNumber, so the schema does much of the work. The description still adds genuine semantics the schema lacks: row-matching keys, the 500-row cap, the vendor-upgrade path, and the interaction between omitted keys and explicit null in customFields. That is real added meaning, though some is restated from the schema.

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?

Opens with a specific verb+resource ("Create or update customers in the partner master"), states a hard cap (max 500 per call), and immediately scopes itself away from the import path ("customer lists that don't arrive via import_historical_sales_orders"). An agent can distinguish it from import_historical_sales_orders and the other upsert_* siblings 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly names the condition that routes work elsewhere (rows arriving via import_historical_sales_orders) and points to list_custom_fields for the customFields vocabulary. It also documents the validateOnly dry-run path and the org-token prerequisite, so the when-to-use and when-to-dry-run decisions are both resolved.

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