Skip to main content
Glama

Create Credit Note

create_credit_note
Destructive

Credit a received customer return — the return receipt's Create credit note. Raises one credit note per fully received return receipt that has none yet, priced as the lines were sold (discounts prorated, the sold tax rate), reconciling the receipt first when needed. Credit notes sync to connected accounting; no refund is paid out. The preview lists each credit note's lines and totals. Two-step: preview=true, then commit with the previewReceipt.

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": {
      "returnId": "<returnId>"
    },
    "name": "create_credit_note"
  }
}

Input Schema

NameRequiredDescriptionDefault
previewNoStep 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing is written until the commit call.
clientIdNoOptional client id (GUID) for operator (unpinned) credentials on 3PL tenants.
returnIdYesCustomer return id (GUID) or number from list_returns.
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 2: the receipt returned by the preview call. Supply with a fresh idempotencyKey to commit.

Output Schema

NameRequiredDescriptionDefault
okNo
numberNo
statusNo
previewNo
returnIdNo
warningsNo
expiresAtNo
creditNotesNo
actionItemIdNo
confirmationNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
approvalRequiredNo
approvalRuleNameNo
idempotentReplayNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses that nothing is written during preview, that the previewReceipt is single-use and must be paired with a fresh idempotencyKey, that the receipt is reconciled first when needed, that credit notes sync to accounting, and that no refund is paid out despite the destructiveHint. These are exactly the consequences an agent needs before invoking a write tool.

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 what gets created and under what conditions, then the mechanics, then the two-step protocol. Dense but every clause carries information; the parenthetical pricing details are the only slightly heavy spot.

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?

An output schema exists so return values need no explanation, annotations carry the safety profile, and the description still covers scope, accounting side effects, absence of refund, and the preview/commit protocol. Nothing material is missing for a correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so preview, previewReceipt, idempotencyKey and returnId are already fully documented in structured fields. The description reinforces the two-step sequencing but adds no syntax, format, or constraint detail beyond what the schema states.

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 (credit) on a specific resource (a received customer return / return receipt) and defines the exact scope: one credit note per fully received return receipt that has none yet. The pricing rule (as sold, discounts prorated, sold tax rate) removes any ambiguity about what is produced.

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 a clear precondition (return receipt must be fully received and have no existing credit note) and an explicit procedural path ('Two-step: preview=true, then commit with the previewReceipt'). It stops short of naming an alternative tool for partially received returns or for refunds, so the when-not case is only implied.

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