Skip to main content
Glama

Red by Big Red Cloud

Create Sales Invoice with Generated Reference

brc_create_sales_invoice_gen_ref
Destructive

Creates a sales invoice using generated references and reconciled product, VAT and Sales-analysis lines. Missing customer contact values remain absent. 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. 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>",
      "payload": "<payload>",
      "routeToken": "<routeToken>"
    },
    "name": "brc_create_sales_invoice_gen_ref"
  }
}

Input Schema

NameRequiredDescriptionDefault
payloadYesRaw BRC payloads for multi-line sales invoices must use `productTrans[]` (one object per product line). Each product line must include its own nested `acEntries[]` for Sales analysis posting — do not send a top-level `acEntries` array on the invoice. Required header fields include customerId, acCode, entryDate, procDate, bookTranTypeId, totalNet, totalVAT, and total. Sales Rep fields are optional; saleRepCode alone does not select a representative. Red validates line amounts, nested analysis values, qty × unit price (using useTaxInclusiveUnitPrice), and header totals before posting, and returns all validation issues together when the payload does not reconcile. Preview-before-posting still shows what Red will post and waits for confirmation before anything is written to Big Red Cloud.
priceBasisNoRequired 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.
confirmCrAnalysisCategoryNoSet true only after the user confirms a CR sales analysis account code is intentional for this product line.
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. Changed7 schema fields changed
    • changedInput schema / properties / payload / description
      Previous value: -"Raw BRC payloads for multi-line sales invoices must use `productTrans[]` (one object per product line). Each product line must include its own nested `acEntries[]` for Sales analysis posting — do not send a top-level `acEntries` array on the invoice. Required header fields include customerId, acCode, entryDate, procDate, saleRepId, saleRepCode, bookTranTypeId, totalNet, totalVAT, total, and unpaid. Red validates line amounts, nested analysis values, qty × unit price (using useTaxInclusiveUnitPrice), and header totals before posting, and returns all validation issues together when the payload does not reconcile. Preview-before-posting still shows what Red will post and waits for confirmation before anything is written to Big Red Cloud."New value: +"Raw BRC payloads for multi-line sales invoices must use `productTrans[]` (one object per product line). Each product line must include its own nested `acEntries[]` for Sales analysis posting — do not send a top-level `acEntries` array on the invoice. Required header fields include customerId, acCode, entryDate, procDate, bookTranTypeId, totalNet, totalVAT, and total. Sales Rep fields are optional; saleRepCode alone does not select a representative. Red validates line amounts, nested analysis values, qty × unit price (using useTaxInclusiveUnitPrice), and header totals before posting, and returns all validation issues together when the payload does not reconcile. Preview-before-posting still shows what Red will post and waits for confirmation before anything is written to Big Red Cloud."
    • addedInput schema / properties / payload / properties / saleRepCode / description
      Added value: +"Optional Sales Rep code accompanying saleRepId. A code alone does not select a representative."
    • addedInput schema / properties / payload / properties / saleRepId / description
      Added value: +"Optional Sales Rep id. No default is injected."
    • addedInput schema / properties / payload / properties / saleRepId / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / payload / properties / saleRepId / maximum
      Added value: +9007199254740991
    • changedInput schema / properties / payload / properties / saleRepId / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / payload / required
      Previous value: -[
      -  "customerId",
      -  "acCode",
      -  "entryDate",
      -  "procDate",
      -  "saleRepId",
      -  "saleRepCode",
      -  "bookTranTypeId",
      -  "totalNet",
      -  "totalVAT",
      -  "total"
      -]New value: +[
      +  "customerId",
      +  "acCode",
      +  "entryDate",
      +  "procDate",
      +  "bookTranTypeId",
      +  "totalNet",
      +  "totalVAT",
      +  "total"
      +]
  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",
      -  "payload"
      -]New value: +[
      +  "companyName",
      +  "payload",
      +  "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",
      -  "payload",
      -  "routeToken"
      -]New value: +[
      +  "companyName",
      +  "payload"
      +]
  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",
      -  "payload"
      -]New value: +[
      +  "companyName",
      +  "payload",
      +  "routeToken"
      +]
  5. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: placeholder tokens invalid, routeToken does not bypass preview, a call without confirmWrite returns confirmation_required with a preview, None is written until confirmed, and confirmCounterpartyExplicit is scoped to the current preview. These disclosures go well past the readOnly/destructive hints.

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?

Front-loaded with purpose and confirmation workflow, but it rambles with disconnected clauses (e.g. 'Missing customer contact values remain absent', 'Sales Rep is optional in Red') and repeats the token/confirmation concepts multiple times. Length is justified by complexity, but some sentences do not clearly earn their place.

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?

Given a nested, multi-param mutation with no output schema and destructive annotations, the description is fairly complete on confirmation, token, and Sales Rep behavior. It could still be clearer on failure/validation return shapes beyond mentioning that all issues are returned together.

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 already 100%, so the baseline is 3, but the description genuinely adds meaning: it explains the saleRepId vs saleRepCode selection rule, that code-only input is rejected, and how confirmWrite/routeToken interact with the workflow. This exceeds the schema's own descriptions.

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?

States a specific verb+resource ('Creates a sales invoice') plus distinguishing scope ('using generated references and reconciled product, VAT and Sales-analysis lines'). This differentiates from the plain create_sales_invoice sibling through 'generated references', though it never explicitly names that sibling as the alternative.

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 strong workflow conditions: requires a valid routeToken, tokens must not be placeholders, confirmWrite flow, and preflight is not confirmation. However, it does not explicitly route the agent between this tool and siblings like brc_create_sales_invoice or brc_generate_sales_invoice_from_quote, so the 'vs alternatives' guidance is implicit.

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.