Skip to main content
Glama

Save Custom Field

save_custom_field
Destructive

Create, restore or edit one custom field definition. Check for a built-in first: a custom field is plain data that reorder recommendations, purchasing, pricing, reports and fulfillment never read. Omit id to create: entity, name, type, purpose and purposeDetail are required, and fieldName (the storage key) is derived from name when omitted. On an item, a purpose a built-in covers (reorder policy, supplier, category/brand/group, lifecycle, pricing, barcode, tracking, units, dimensions, location, components, tags, notes) is refused with BUILT_IN_ALTERNATIVE naming that built-in: show it to the user, and create the field only if they still want it, with builtInReviewed=true. Creating the entity.fieldName of a deleted field restores it with the values records still carry, so it must keep its type; the preview says so and counts those records. Pass id to edit, where every omitted field keeps its value; entity, fieldName and type never change. Options for list/multilist fields are matched by id, then name, so kept options keep the values pointing at them; options left out are removed, and the preview counts the records whose value they strand. A field active price books depend on keeps the options they reference. Requires an operator (unpinned) credential. For bulk onboarding use upsert_custom_fields.

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": {
      "input": "<input>"
    },
    "name": "save_custom_field"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoThe custom field id (GUID) to edit; omit to create or restore.
inputYesThe definition to save; see upsert_custom_fields for each property.
previewNoStep 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing changes until the commit call.
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 2 of the required two-step write: the receipt returned by the preview call. Supply together with a fresh idempotencyKey to commit; calls without it are refused.

Output Schema

NameRequiredDescriptionDefault
okNo
deletedNo
previewNo
expiresAtNo
customFieldNo
actionItemIdNo
confirmationNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
idempotentReplayNo

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 declare destructiveHint=true and idempotentHint=false; the description goes well beyond that by naming what gets destroyed (options left out are removed and strand records), how restore behaves on a deleted field's key and type, that active price books protect referenced options, and that creates are refused with BUILT_IN_ALTERNATIVE until builtInReviewed=true. This is exactly the kind of consequence disclosure the annotations alone cannot carry.

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?

The verb and create-vs-edit split are front-loaded, and nearly every clause carries a distinct rule or consequence. It does become a dense wall of text whose later clauses restate schema facts (required fields, type immutability), costing some readability.

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 destructive, two-step, nested-object write tool this is comprehensive: identity/upsert rules, restore semantics, the built-in challenge workflow, option lifecycle, and the preview/commit protocol are all covered. With an output schema present, it correctly omits return-value description.

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%, so the baseline is 3, but the description adds cross-parameter meaning: fieldName is derived from name in snake_case when omitted, entity/fieldName/type never change on update, and purpose is ignored on update while driving the built-in challenge on create. Minor friction: it says options are 'matched by id, then name' while the schema says matching is by name, a small inconsistency rather than a contradiction.

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 opening sentence names a precise verb set and resource: 'Create, restore or edit one custom field definition.' It explicitly scopes to a single field and later contrasts with the bulk sibling ('For bulk onboarding use upsert_custom_fields'), so an agent can choose between them without opening either 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?

Guidance is explicit and conditional: 'Omit id to create', 'Pass id to edit', check for a built-in first on item entities, and use upsert_custom_fields for bulk. It even states the two-step preview/commit requirement and that a credential of a specific type is needed, leaving little to inference.

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