Skip to main content
Glama
Jacques-Murray

WooCommerce MCP Server

Create WooCommerce Order Refund

woocommerce_create_order_refund
Destructive

Create a refund for a WooCommerce order, either a flat amount or per line item. Specify order ID and optionally amount, reason, or items to refund.

Instructions

Issue a refund against an order, either as a flat amount or itemized by line item. This is a DESTRUCTIVE, hard-to-reverse financial operation - confirm details with the user before calling.

Args:

  • order_id (number, required)

  • amount (string, optional): flat refund amount; required if line_items is omitted

  • reason (string, optional)

  • line_items (array, optional): [{id, quantity?, refund_total?}] for itemized refunds

  • api_refund (boolean, default true): attempt gateway refund vs. record-only

  • response_format ('markdown'|'json'): default 'markdown'

Returns: The created refund object.

Examples:

  • Use when: "refund $15 of order 100 for a damaged item" -> order_id=100, amount="15.00", reason="Damaged item"

Error Handling:

  • Returns "Error: Bad request (400)" if the amount exceeds the order total or the gateway rejects the refund.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNoAmount to refund as a numeric string, e.g. '10.00'. If omitted with no line_items, refunds the full order total.
reasonNoReason for the refund, shown in admin and possibly to the customer
order_idYesThe numeric WooCommerce order ID to refund
api_refundNoIf true (default) and the payment gateway supports it, attempts to refund via the gateway API; set false to only record the refund in WooCommerce
line_itemsNoSpecific line items to refund; omit to do a simple amount-based refund
response_formatNoOutput format: 'markdown' for human-readable text or 'json' for machine-readable structured datamarkdown
Behavior5/5

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

Annotations already provide destructiveHint=true, readOnlyHint=false, idempotentHint=false, openWorldHint=true. The description reinforces this with 'DESTRUCTIVE, hard-to-reverse financial operation' and adds the important behavioral guideline to confirm with the user. No contradictions.

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?

The description is well-structured: first sentence states purpose, followed by a critical warning, then a clear listing of arguments with types, return value, an example, and error handling. Every sentence adds value, and it is appropriately concise.

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?

Given the tool's financial nature and multiple parameters, the description covers purpose, parameters (with types and relations), return type, example usage, and error handling. No output schema exists, but the return is described. Annotations cover safety. Complete for an agent to use correctly.

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% (all parameters have schema descriptions). The description adds value by clarifying the mutual dependency between 'amount' and 'line_items' (amount required if line_items omitted) and includes an example mapping natural language to parameters. This goes beyond the schema's own descriptions.

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 the tool's purpose: 'Issue a refund against an order, either as a flat amount or itemized by line item.' The verb 'issue a refund' is specific and the resource is 'order'. It distinguishes from sibling tools that deal with orders (create, update, delete, list) and other entities.

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?

The description explicitly warns that this is a destructive, hard-to-reverse financial operation and advises confirming details with the user before calling. It provides an example scenario. It does not explicitly list alternatives, but among siblings, only 'woocommerce_list_order_refunds' exists for refunds, so usage context is clear.

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/Jacques-Murray/woocommerce-mcp-server'

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