Skip to main content
Glama

Red by Big Red Cloud

Batch Sales Credit Notes

brc_batch_sales_credit_notes
Destructive

Processes sales credit notes in a batch using reconciled product, VAT and Sales-analysis lines. Results are reported per submitted item and partial success is possible. Requires a valid routeToken issued for the matching action workflow. The token remains valid through lookup, preview and the permitted transaction. Placeholder tokens are invalid. A routeToken does not bypass preview or explicit-confirmation requirements. A call without confirmWrite: true returns confirmation_required and a payload preview. confirmWrite: true applies the previewed change after explicit confirmation. Passing preflight is not confirmation. Requires confirmCounterpartyExplicit: true; confirmation is scoped to the counterparty selected for the current preview.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesBatch items to process. Maximum 20 items per request.
priceBasisNoApplies to every sales invoice/credit note item in this batch. Required when Gross Price Entry is enabled. Use `gross` when unit prices are VAT-inclusive/gross. Use `net` when unit prices are VAT-exclusive/net.
routeTokenYesOpaque routeToken from brc_route_request for this action workflow. Required for transactional tools. Routing permission only — does not replace preview-before-posting or confirmWrite.
companyNameYesCompany context name, for example YOUR-COMPANY-NAME.
confirmWriteNoMust be true only after a plain-English preview before posting has been shown in the current conversation and the user explicitly confirmed posting (for example yes, create it / post it now / confirm). Never set true on the first call or because the user initially asked to create something. Nothing is written to Big Red Cloud until you confirm.
connectionRefNoOpaque Red connection reference returned by brc_confirm_company_connection. Pass this exact value on every later tool call when the MCP client rotates session ids (for example Vibe/Mistral). Keep reusing the same connectionRef after successful tool calls — do not start a new connection because a lookup returned empty or partial data. It is not an API key and does not contain credentials.
confirmCrAnalysisCategoryNoApplies to every sales document item in this batch. Set true only after the user confirms a CR (customer) sales analysis account code is intentional for these product lines.
confirmCounterpartyExplicitNoMust be true only after the user explicitly named or confirmed the customer, supplier, or other counterparty in the current conversation. Never set true because a customer or supplier appeared in an earlier preview, was inferred from context, or was filled in without the user's explicit choice in this conversation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / items / items / additionalProperties
      Previous value: -{}New value: +false
    • addedInput schema / properties / items / items / properties
      Added value: +{
      +  "item": {
      +    "oneOf": [
      +      {
      +        "additionalProperties": false,
      +        "properties": {
      +          "acCode": {
      +            "description": "Customer account code.",
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "accountCode": {
      +            "description": "Sales analysis account code.",
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "analysisCategoryId": {
      +            "description": "Sales analysis category id.",
      +            "exclusiveMinimum": 0,
      +            "maximum": 9007199254740991,
      +            "type": "integer"
      +          },
      +          "bookTranTypeId": {
      +            "description": "Sales Credit Note book transaction type id; use 7.",
      +            "exclusiveMinimum": 0,
      +            "maximum": 9007199254740991,
      +            "type": "integer"
      +          },
      +          "customerId": {
      +            "description": "BRC customer id.",
      +            "exclusiveMinimum": 0,
      +            "maximum": 9007199254740991,
      +            "type": "integer"
      +          },
      +          "description": {
      +            "description": "Product-line analysis description.",
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "entryDate": {
      +            "description": "Entry date in ISO format.",
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "netAmount": {
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          },
      +          "note": {
      +            "description": "Sales credit note.",
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "procDate": {
      +            "description": "Processing date in ISO format.",
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "productCode": {
      +            "description": "BRC product code.",
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "productId": {
      +            "description": "BRC product id; placeholder ids 0 and 1 are prohibited.",
      +            "exclusiveMinimum": 0,
      +            "maximum": 9007199254740991,
      +            "type": "integer"
      +          },
      +          "quantity": {
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          },
      +          "reference": {
      +            "type": "string"
      +          },
      +          "saleRepCode": {
      +            "description": "BRC sales representative code.",
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "saleRepId": {
      +            "description": "BRC sales representative id.",
      +            "exclusiveMinimum": 0,
      +            "maximum": 9007199254740991,
      +            "type": "integer"
      +          },
      +          "unitPrice": {
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          },
      +          "vatPercentage": {
      +            "type": "number"
      +          },
      +          "vatRateId": {
      +            "description": "BRC VAT rate id.",
      +            "exclusiveMinimum": 0,
      +            "maximum": 9007199254740991,
      +            "type": "integer"
      +          }
      +        },
      +        "required": [
      +          "customerId",
      +          "acCode",
      +          "note",
      +          "entryDate",
      +          "procDate",
      +          "bookTranTypeId",
      +          "analysisCategoryId",
      +          "accountCode",
      +          "description",
      +          "netAmount",
      +          "vatRateId",
      +          "vatPercentage",
      +          "productId",
      +          "productCode",
      +          "quantity",
      +          "unitPrice",
      +          "saleRepId",
      +          "saleRepCode"
      +        ],
      +        "type": "object"
      +      },
      +      {
      +        "additionalProperties": false,
      +        "properties": {
      +          "acCode": {
      +            "description": "Customer account code.",
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "bookTranTypeId": {
      +            "const": 7,
      +            "type": "number"
      +          },
      +          "customFields": {
      +            "items": {},
      +            "type": "array"
      +          },
      +          "customerId": {
      +            "description": "BRC customer id.",
      +            "exclusiveMinimum": 0,
      +            "maximum": 9007199254740991,
      +            "type": "integer"
      +          },
      +          "deliveryTo": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              }
      +            ]
      +          },
      +          "details": {
      +            "anyOf": [
      +              {},
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "entryDate": {
      +            "description": "Entry date in ISO format.",
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "id": {
      +            "maximum": 9007199254740991,
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "loType": {
      +            "type": "string"
      +          },
      +          "netGoods": {
      +            "type": "number"
      +          },
      +          "netServices": {
      +            "type": "number"
      +          },
      +          "note": {
      +            "type": "string"
      +          },
      +          "ourReference": {
      +            "type": "string"
      +          },
      +          "procDate": {
      +            "description": "Processing date in ISO format.",
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "productTrans": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "acEntries": {
      +                  "items": {
      +                    "additionalProperties": false,
      +                    "properties": {
      +                      "accountCode": {
      +                        "description": "Sales analysis account code.",
      +                        "minLength": 1,
      +                        "type": "string"
      +                      },
      +                      "analysisCategoryId": {
      +                        "description": "Sales analysis category id.",
      +                        "exclusiveMinimum": 0,
      +                        "maximum": 9007199254740991,
      +                        "type": "integer"
      +                      },
      +                      "description": {
      +                        "type": "string"
      +                      },
      +                      "id": {
      +                        "maximum": 9007199254740991,
      +                        "minimum": 0,
      +                        "type": "integer"
      +                      },
      +                      "value": {
      +                        "exclusiveMaximum": 0,
      +                        "type": "number"
      +                      }
      +                    },
      +                    "required": [
      +                      "accountCode",
      +                      "analysisCategoryId",
      +                      "value"
      +                    ],
      +                    "type": "object"
      +                  },
      +                  "minItems": 1,
      +                  "type": "array"
      +                },
      +                "amount": {
      +                  "exclusiveMaximum": 0,
      +                  "type": "number"
      +                },
      +                "amountNet": {
      +                  "exclusiveMaximum": 0,
      +                  "type": "number"
      +                },
      +                "id": {
      +                  "maximum": 9007199254740991,
      +                  "minimum": 0,
      +                  "type": "integer"
      +                },
      +                "percentage": {
      +                  "type": "number"
      +                },
      +                "productCode": {
      +                  "description": "BRC product code.",
      +                  "minLength": 1,
      +                  "type": "string"
      +                },
      +                "productId": {
      +                  "description": "BRC product id; placeholder ids 0 and 1 are prohibited.",
      +                  "exclusiveMinimum": 0,
      +                  "maximum": 9007199254740991,
      +                  "type": "integer"
      +                },
      +                "quantity": {
      +                  "exclusiveMaximum": 0,
      +                  "type": "number"
      +                },
      +                "tranNotes": {
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "minItems": 1,
      +                  "type": "array"
      +                },
      +                "unitPrice": {
      +                  "exclusiveMinimum": 0,
      +                  "type": "number"
      +                },
      +                "useTaxInclusiveUnitPrice": {
      +                  "type": "boolean"
      +                },
      +                "vat": {
      +                  "exclusiveMaximum": 0,
      +                  "type": "number"
      +                },
      +                "vatAmount": {
      +                  "exclusiveMaximum": 0,
      +                  "type": "number"
      +                },
      +                "vatAnalysisTypeId": {
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "vatRateId": {
      +                  "description": "BRC VAT rate id.",
      +                  "exclusiveMinimum": 0,
      +                  "maximum": 9007199254740991,
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "amount",
      +                "amountNet",
      +                "percentage",
      +                "productId",
      +                "productCode",
      +                "quantity",
      +                "unitPrice",
      +                "vat",
      +                "vatRateId",
      +                "vatAnalysisTypeId",
      +                "tranNotes",
      +                "acEntries"
      +              ],
      +              "type": "object"
      +            },
      +            "minItems": 1,
      +            "type": "array"
      +          },
      +          "quoteId": {
      +            "maximum": 9007199254740991,
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "reference": {
      +            "type": "string"
      +          },
      +          "saleRepCode": {
      +            "description": "BRC sales representative code.",
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "saleRepId": {
      +            "description": "BRC sales representative id.",
      +            "exclusiveMinimum": 0,
      +            "maximum": 9007199254740991,
      +            "type": "integer"
      +          },
      +          "total": {
      +            "exclusiveMaximum": 0,
      +            "type": "number"
      +          },
      +          "totalNet": {
      +            "exclusiveMaximum": 0,
      +            "type": "number"
      +          },
      +          "totalVAT": {
      +            "exclusiveMaximum": 0,
      +            "type": "number"
      +          },
      +          "unpaid": {
      +            "exclusiveMaximum": 0,
      +            "type": "number"
      +          },
      +          "useTaxInclusiveUnitPrice": {
      +            "type": "boolean"
      +          },
      +          "vatTypeId": {
      +            "description": "BRC VAT type id.",
      +            "exclusiveMinimum": 0,
      +            "maximum": 9007199254740991,
      +            "type": "integer"
      +          },
      +          "yourReference": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "productTrans",
      +          "saleRepId",
      +          "saleRepCode",
      +          "customerId",
      +          "unpaid",
      +          "vatTypeId",
      +          "totalNet",
      +          "totalVAT",
      +          "bookTranTypeId",
      +          "acCode",
      +          "entryDate",
      +          "procDate",
      +          "total",
      +          "customFields"
      +        ],
      +        "type": "object"
      +      }
      +    ]
      +  },
      +  "opCode": {
      +    "const": 1,
      +    "description": "BRC batch create operation code. Must be 1.",
      +    "type": "number"
      +  }
      +}
    • removedInput schema / properties / items / items / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / items / items / required
      Added value: +[
      +  "opCode",
      +  "item"
      +]
  2. Changed2 schema fields changed
    • addedInput schema / properties / routeToken
      Added value: +{
      +  "description": "Opaque routeToken from brc_route_request for this action workflow. Required for transactional tools. Routing permission only — does not replace preview-before-posting or confirmWrite.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "companyName",
      -  "items"
      -]New value: +[
      +  "companyName",
      +  "items",
      +  "routeToken"
      +]
  3. Changed2 schema fields changed
    • removedInput schema / properties / routeToken
      Removed value: -{
      -  "description": "Opaque routeToken from brc_route_request for this action workflow. Required for transactional tools. Routing permission only — does not replace preview-before-posting or confirmWrite.",
      -  "minLength": 1,
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "companyName",
      -  "items",
      -  "routeToken"
      -]New value: +[
      +  "companyName",
      +  "items"
      +]
  4. Changed2 schema fields changed
    • addedInput schema / properties / routeToken
      Added value: +{
      +  "description": "Opaque routeToken from brc_route_request for this action workflow. Required for transactional tools. Routing permission only — does not replace preview-before-posting or confirmWrite.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "companyName",
      -  "items"
      -]New value: +[
      +  "companyName",
      +  "items",
      +  "routeToken"
      +]
  5. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only say readOnlyHint=false and destructiveHint=true; the description carries the real burden and succeeds fully. It discloses partial success with per-item results, the token validity window, that tokens never bypass preview/confirmation, the two-phase confirmWrite flow, and that passing preflight is not confirmation. This is exemplary disclosure for a destructive batch 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?

The description is long — nine sentences — but it is front-loaded with the core purpose and every sentence carries a distinct operational fact. There is mild overlap between 'does not bypass preview or explicit-confirmation' and 'passing preflight is not confirmation'. For a high-stakes destructive batch tool, the density is justified.

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

Completeness4/5

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

With no output schema, the description gives a useful-level statement of results (per-item reporting, partial success possible) without overpromising. The safety protocol — preview, explicit confirmation, counterparty confirmation, token requirements — is thoroughly covered. Minor gap: the 20-item batch cap lives only in the schema, and detailed return structure is absent, but the description does its job.

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 description coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema. It explains routeToken lifecycle (valid through lookup, preview, transaction; placeholders invalid), the confirmWrite two-step semantics, and counterparty-confirmation scoping. This enriches the short schema field 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?

States a specific verb and resource — 'Processes sales credit notes' — and immediately scopes it as a batch operation, distinguishing it from single-document siblings like brc_create_sales_credit_note. The mention of reconciled product, VAT and Sales-analysis lines adds precision about what the batch consumes. The purpose is unambiguous and differentiated.

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 very clear workflow context: a first call returns confirmation_required plus a payload preview, and confirmWrite: true may only follow explicit user confirmation. It also pins down prerequisites — a valid routeToken for the matching action workflow and confirmCounterpartyExplicit: true. It names no alternative tool or explicit exclusion, so it stops just short of full when-to-use-vs-sibling guidance.

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.