Skip to main content
Glama

Edit Order

edit_order
DestructiveIdempotent

Edits an existing order of the current company. Editing REPLACES the whole order: it is not a partial update, and fields you leave out can be reset or cleared. So first fetch the current order with get_order_by_id (or find it in get_current_active_orders or get_current_scheduled_orders), then send the COMPLETE order in orderInfo with only the changes the user asked for applied. customer, restaurant, costInfo, paymentInfo and activityLog are always required. Cost amounts are saved in two groups, (totalCost, tax, discount, serviceFee) and (deliveryFee, tip, cashTip). If any value in a group changes, the whole group is rewritten and omitted values become 0, so always send every amount. deliveryInstruction is cleared if omitted. The restaurant name and phoneNumber are cleared if omitted, paymentMethod is cleared if omitted, and isCatering resets to false if omitted, so send the current values. The restaurant address is always required. orderNumber and orderItems are left unchanged if omitted. A change to addressDetail is only saved if the one-line address, the name, the phone or the email also changes, so change the address line whenever the address breakdown changes. Changing an address line triggers address lookup, which can take a few seconds. If the call says it could not confirm whether the order was updated, fetch the order and compare before trying again.You also need to think if editing something needs change in other fields. For example, changing the quantity of an item should also impact on totalCost. You should ask the user and get confirmation before making any such changes.

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": {
      "orderId": "<orderId>",
      "orderInfo": "<orderInfo>"
    },
    "name": "edit_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
orderIdYesId of the order to edit
orderInfoYesThe complete order after the requested changes

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?

Goes well beyond the destructiveHint/idempotentHint annotations by enumerating exactly what gets cleared when omitted (deliveryInstruction, restaurant name/phone, paymentMethod, isCatering), how the two cost groups are rewritten atomically with omitted amounts becoming 0, and the conditional save rule for addressDetail. It also discloses that address edits trigger a multi-second geocode lookup and gives recovery advice for the ambiguous 'could not confirm whether the order was updated' outcome.

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?

Front-loaded with the replace semantics before the field-by-field rules, and almost every sentence corresponds to a real failure mode. The closing paragraph about considering ripple effects is looser prose and largely restates the earlier instruction to confirm changes with the user, so it is slightly padded but not enough to hurt usability.

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 deeply nested destructive mutation with no output schema, the description covers the whole call lifecycle: read first, send complete payload, obey per-field clearing rules, handle geocoding latency, and recover from an indeterminate result. Nothing an agent needs in order to call this correctly is missing.

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 repeats several clearing rules, so the description earns credit mainly for the cost-group rule (totalCost/tax/discount/serviceFee vs deliveryFee/tip/cashTip) which appears nowhere in the schema. It also restates the always-required set and the addressDetail trigger condition, which adds some but partially duplicates the schema text.

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 and resource ('Edits an existing order of the current company') and immediately clarifies the crucial semantic that editing REPLACES the whole order rather than patching it. That single distinction separates it from any partial-update interpretation the agent might otherwise assume.

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 mandates a read-before-write workflow and names three concrete siblings (get_order_by_id, get_current_active_orders, get_current_scheduled_orders) as the sources for the current state. It also prescribes a confirmation step with the user before cascading derived changes, so both the tool-selection and the interaction contract are spelled out.

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