Skip to main content
Glama

Red by Big Red Cloud

Batch Sales Invoices

brc_batch_sales_invoices
Destructive

Multi-record accounting write for sales invoices. Creates invoices up to the configured per-request maximum; opCode 1 requests creation. A preview and explicit user confirmation are required before posting. Results are reported per item and partial success is possible. Existing invoice changes use the separate single-invoice update workflow. Product, Sales VAT and Sales-analysis checks apply. Sales Rep is optional in Red. A positive saleRepId selects a representative; saleRepCode may accompany it. Code-only input is rejected because it does not reliably associate a Sales Rep. Company-specific BRC validation still applies. Maximum 100 items per batch request. 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.

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": {
      "companyName": "<companyName>",
      "items": "<items>",
      "routeToken": "<routeToken>"
    },
    "name": "brc_batch_sales_invoices"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYesBatch items to process. Maximum 100 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. Changed2 schema fields changed
    • changedInput schema / properties / items / items / additionalProperties
      Previous value: -{}New value: +false
    • addedInput schema / properties / items / items / properties / confirmCrAnalysisCategory
      Added value: +{
      +  "description": "Set true only after the user confirms a CR sales analysis account code is intentional for this invoice.",
      +  "type": "boolean"
      +}
  2. Changed6 schema fields changed
    • addedInput schema / properties / items / items / properties / item / properties / saleRepCode / description
      Added value: +"Optional Sales Rep code accompanying saleRepId. A code alone does not select a representative."
    • addedInput schema / properties / items / items / properties / item / properties / saleRepId / description
      Added value: +"Optional Sales Rep id. No default is injected."
    • addedInput schema / properties / items / items / properties / item / properties / saleRepId / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / items / items / properties / item / properties / saleRepId / maximum
      Added value: +9007199254740991
    • changedInput schema / properties / items / items / properties / item / properties / saleRepId / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / items / items / properties / item / required
      Previous value: -[
      -  "customerId",
      -  "acCode",
      -  "entryDate",
      -  "procDate",
      -  "saleRepId",
      -  "saleRepCode",
      -  "bookTranTypeId",
      -  "totalNet",
      -  "totalVAT",
      -  "total"
      -]New value: +[
      +  "customerId",
      +  "acCode",
      +  "entryDate",
      +  "procDate",
      +  "bookTranTypeId",
      +  "totalNet",
      +  "totalVAT",
      +  "total"
      +]
  3. Changed2 schema fields changed
    • changedInput schema / properties / items / description
      Previous value: -"Batch items to process. Maximum 20 items per request."New value: +"Batch items to process. Maximum 100 items per request."
    • changedInput schema / properties / items / maxItems
      Previous value: -20New value: +100
  4. Changed3 schema fields changed
    • addedInput schema / properties / items / items / properties
      Added value: +{
      +  "item": {
      +    "additionalProperties": {},
      +    "description": "Complete BRC sales-invoice payload. Use nested productTrans lines with nested acEntries, matching brc_create_sales_invoice_gen_ref.",
      +    "properties": {
      +      "acCode": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "bookTranTypeId": {
      +        "type": "number"
      +      },
      +      "customFields": {
      +        "items": {},
      +        "type": "array"
      +      },
      +      "customerId": {
      +        "type": "number"
      +      },
      +      "deliveryTo": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        ]
      +      },
      +      "entryDate": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "id": {
      +        "type": "number"
      +      },
      +      "netGoods": {
      +        "type": "number"
      +      },
      +      "netServices": {
      +        "type": "number"
      +      },
      +      "note": {
      +        "type": "string"
      +      },
      +      "procDate": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "productTrans": {
      +        "items": {
      +          "additionalProperties": {},
      +          "properties": {
      +            "acEntries": {
      +              "items": {
      +                "additionalProperties": {},
      +                "properties": {
      +                  "accountCode": {
      +                    "minLength": 1,
      +                    "type": "string"
      +                  },
      +                  "analysisCategoryId": {
      +                    "type": "number"
      +                  },
      +                  "description": {
      +                    "type": "string"
      +                  },
      +                  "id": {
      +                    "type": "number"
      +                  },
      +                  "value": {
      +                    "type": "number"
      +                  }
      +                },
      +                "required": [
      +                  "accountCode",
      +                  "analysisCategoryId",
      +                  "value"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "amount": {
      +              "type": "number"
      +            },
      +            "amountNet": {
      +              "type": "number"
      +            },
      +            "id": {
      +              "type": "number"
      +            },
      +            "percentage": {
      +              "type": "number"
      +            },
      +            "productCode": {
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "productId": {
      +              "type": "number"
      +            },
      +            "quantity": {
      +              "type": "number"
      +            },
      +            "tranNotes": {
      +              "items": {
      +                "type": "string"
      +              },
      +              "type": "array"
      +            },
      +            "unitPrice": {
      +              "type": "number"
      +            },
      +            "useTaxInclusiveUnitPrice": {
      +              "type": "boolean"
      +            },
      +            "vat": {
      +              "type": "number"
      +            },
      +            "vatAnalysisTypeId": {
      +              "type": "number"
      +            },
      +            "vatRateId": {
      +              "type": "number"
      +            }
      +          },
      +          "required": [
      +            "amount",
      +            "amountNet",
      +            "percentage",
      +            "productCode",
      +            "quantity",
      +            "unitPrice",
      +            "vat",
      +            "vatRateId",
      +            "vatAnalysisTypeId",
      +            "tranNotes"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "quoteId": {
      +        "type": "number"
      +      },
      +      "saleRepCode": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "saleRepId": {
      +        "type": "number"
      +      },
      +      "total": {
      +        "type": "number"
      +      },
      +      "totalNet": {
      +        "type": "number"
      +      },
      +      "totalVAT": {
      +        "type": "number"
      +      },
      +      "unpaid": {
      +        "type": "number"
      +      },
      +      "useTaxInclusiveUnitPrice": {
      +        "type": "boolean"
      +      },
      +      "vatTypeId": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "customerId",
      +      "acCode",
      +      "entryDate",
      +      "procDate",
      +      "saleRepId",
      +      "saleRepCode",
      +      "bookTranTypeId",
      +      "totalNet",
      +      "totalVAT",
      +      "total"
      +    ],
      +    "type": "object"
      +  },
      +  "opCode": {
      +    "default": 1,
      +    "description": "BRC batch operation code. Use 1 to create a sales invoice.",
      +    "maximum": 9007199254740991,
      +    "minimum": -9007199254740991,
      +    "type": "integer"
      +  }
      +}
    • removedInput schema / properties / items / items / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / items / items / required
      Added value: +[
      +  "item"
      +]
  5. 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"
      +]
  6. 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"
      +]
  7. 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"
      +]
  8. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=true), the description discloses the full write protocol: routeToken issuance, preview-then-confirm gating, that 'Results are reported per item and partial success is possible,' the 100-item cap, and the fact that a routeToken 'does not bypass preview or explicit-confirmation requirements.' It also flags validation domains (Product, Sales VAT, Sales-analysis checks) that will reject payloads.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The write-gating rules are front-loaded, but the same ideas are restated several times: preview/confirmation is asserted in the opening sentence, again with routeToken, again as 'Passing preflight is not confirmation,' and again with confirmWrite. Consolidating the token and confirmation sentences would remove redundancy without losing any rule.

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 batch mutation with no output schema, the description covers everything an agent needs: item limit, per-item result reporting, partial-success behavior, token lifecycle, the two explicit-confirmation flags, and the validation gates that can reject a call. Return values are adequately characterized by the per-item/partial-success statement.

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 cross-parameter meaning the schema cannot: it ties opCode 1 to creation, explains the confirmWrite/routeToken/confirmCounterpartyExplicit interplay as a workflow rather than isolated flags, and states 'Code-only input is rejected because it does not reliably associate a Sales Rep.' Some of this repeats schema text (saleRepId optional, routeToken opaque), keeping it below the top score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Multi-record accounting write for sales invoices,' and pins down that 'opCode 1 requests creation.' It distinguishes itself from the single-record path by noting that 'Existing invoice changes use the separate single-invoice update workflow.' It does not name the sibling batch tools (e.g., brc_batch_sales_credit_notes) or brc_create_sales_invoice explicitly, so differentiation relies on inference.

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?

Usage context is unusually explicit: preview and explicit confirmation are required before posting, and 'A call without confirmWrite: true returns confirmation_required and a payload preview' tells the agent exactly what the first call does. It also routes updates elsewhere and warns that 'Passing preflight is not confirmation.' What is missing is an explicit pointer to the batch alternative for credit notes or to brc_create_sales_invoice for single records.

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.