Skip to main content
Glama

Red by Big Red Cloud

Create Sales Invoice

brc_create_sales_invoice
Destructive

Creates a sales invoice with a caller-supplied reference 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>",
      "customerId": "<customerId>",
      "acCode": "<acCode>",
      "entryDate": "<entryDate>",
      "procDate": "<procDate>",
      "bookTranTypeId": "<bookTranTypeId>",
      "analysisCategoryId": "<analysisCategoryId>",
      "accountCode": "<accountCode>",
      "description": "<description>",
      "netAmount": "<netAmount>",
      "vatRateId": "<vatRateId>",
      "vatPercentage": "<vatPercentage>",
      "productId": "<productId>",
      "productCode": "<productCode>",
      "quantity": "<quantity>",
      "unitPrice": "<unitPrice>",
      "routeToken": "<routeToken>"
    },
    "name": "brc_create_sales_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
noteNoOptional. BRC "Note" field on the sales document (JSON field `note`). Leave blank to default it to the customer name (BRC customer "Name" / JSON `name`). Do not use the product name as the note. Only set this when the user explicitly provides a note.
acCodeYes
procDateYes
quantityYes
entryDateYes
netAmountYes
productIdYesproductCode is the BRC product "Code" (JSON `productCode`); productId is the BRC product "Id" (JSON `productId`) from brc_list_products. The product name is not a payload field — do not place it in the BRC "Note" field (JSON `note`).
referenceNoOptional. BRC "Reference" field (JSON field `reference`). BRC "Our Ref" (JSON `ourReference`) and BRC "Your Ref" (JSON `yourReference`) default to this value when not supplied separately.
saleRepIdNoOptional Sales Rep id. No default is injected.
unitPriceYes
vatRateIdYes
customerIdYes
deliveryToNoOptional. BRC "Delivery To" address (JSON field `deliveryTo`). Leave blank unless the user explicitly provides a delivery address. Do not invent or default a delivery address (for example "MCP Test").
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.
accountCodeYes
companyNameYesCompany context name, for example YOUR-COMPANY-NAME.
descriptionYesProduct line description shown on the document line (BRC product line description / JSON `tranNotes`, also used on the line's analysis entry description). This is the line narrative, not the BRC "Note" field.
productCodeYesproductCode is the BRC product "Code" (JSON `productCode`); productId is the BRC product "Id" (JSON `productId`) from brc_list_products. The product name is not a payload field — do not place it in the BRC "Note" field (JSON `note`).
saleRepCodeNoOptional Sales Rep code accompanying saleRepId. A code alone does not select a representative.
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.
customerNameNoOptional. The selected customer's name (BRC customer "Name" / JSON `name`). Used as the default sales document note (BRC "Note" / JSON `note`) when no explicit note is given.
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.
vatPercentageYes
bookTranTypeIdYes
analysisCategoryIdYes
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. Changed3 schema fields changed
    • changedInput schema / properties / saleRepCode / description
      Previous value: -"Sales rep code from brc_list_sales_reps."New value: +"Optional Sales Rep code accompanying saleRepId. A code alone does not select a representative."
    • changedInput schema / properties / saleRepId / description
      Previous value: -"Sales rep id from brc_list_sales_reps."New value: +"Optional Sales Rep id. No default is injected."
    • changedInput schema / required
      Previous value: -[
      -  "companyName",
      -  "customerId",
      -  "acCode",
      -  "entryDate",
      -  "procDate",
      -  "bookTranTypeId",
      -  "analysisCategoryId",
      -  "accountCode",
      -  "description",
      -  "netAmount",
      -  "vatRateId",
      -  "vatPercentage",
      -  "productId",
      -  "productCode",
      -  "quantity",
      -  "unitPrice",
      -  "saleRepId",
      -  "saleRepCode",
      -  "routeToken"
      -]New value: +[
      +  "companyName",
      +  "customerId",
      +  "acCode",
      +  "entryDate",
      +  "procDate",
      +  "bookTranTypeId",
      +  "analysisCategoryId",
      +  "accountCode",
      +  "description",
      +  "netAmount",
      +  "vatRateId",
      +  "vatPercentage",
      +  "productId",
      +  "productCode",
      +  "quantity",
      +  "unitPrice",
      +  "routeToken"
      +]
  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",
      -  "customerId",
      -  "acCode",
      -  "entryDate",
      -  "procDate",
      -  "bookTranTypeId",
      -  "analysisCategoryId",
      -  "accountCode",
      -  "description",
      -  "netAmount",
      -  "vatRateId",
      -  "vatPercentage",
      -  "productId",
      -  "productCode",
      -  "quantity",
      -  "unitPrice",
      -  "saleRepId",
      -  "saleRepCode"
      -]New value: +[
      +  "companyName",
      +  "customerId",
      +  "acCode",
      +  "entryDate",
      +  "procDate",
      +  "bookTranTypeId",
      +  "analysisCategoryId",
      +  "accountCode",
      +  "description",
      +  "netAmount",
      +  "vatRateId",
      +  "vatPercentage",
      +  "productId",
      +  "productCode",
      +  "quantity",
      +  "unitPrice",
      +  "saleRepId",
      +  "saleRepCode",
      +  "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",
      -  "customerId",
      -  "acCode",
      -  "entryDate",
      -  "procDate",
      -  "bookTranTypeId",
      -  "analysisCategoryId",
      -  "accountCode",
      -  "description",
      -  "netAmount",
      -  "vatRateId",
      -  "vatPercentage",
      -  "productId",
      -  "productCode",
      -  "quantity",
      -  "unitPrice",
      -  "saleRepId",
      -  "saleRepCode",
      -  "routeToken"
      -]New value: +[
      +  "companyName",
      +  "customerId",
      +  "acCode",
      +  "entryDate",
      +  "procDate",
      +  "bookTranTypeId",
      +  "analysisCategoryId",
      +  "accountCode",
      +  "description",
      +  "netAmount",
      +  "vatRateId",
      +  "vatPercentage",
      +  "productId",
      +  "productCode",
      +  "quantity",
      +  "unitPrice",
      +  "saleRepId",
      +  "saleRepCode"
      +]
  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",
      -  "customerId",
      -  "acCode",
      -  "entryDate",
      -  "procDate",
      -  "bookTranTypeId",
      -  "analysisCategoryId",
      -  "accountCode",
      -  "description",
      -  "netAmount",
      -  "vatRateId",
      -  "vatPercentage",
      -  "productId",
      -  "productCode",
      -  "quantity",
      -  "unitPrice",
      -  "saleRepId",
      -  "saleRepCode"
      -]New value: +[
      +  "companyName",
      +  "customerId",
      +  "acCode",
      +  "entryDate",
      +  "procDate",
      +  "bookTranTypeId",
      +  "analysisCategoryId",
      +  "accountCode",
      +  "description",
      +  "netAmount",
      +  "vatRateId",
      +  "vatPercentage",
      +  "productId",
      +  "productCode",
      +  "quantity",
      +  "unitPrice",
      +  "saleRepId",
      +  "saleRepCode",
      +  "routeToken"
      +]
  5. First observed

TDQS

A4/5.0
Behavior5/5

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

The description adds substantial context beyond the destructive annotation: routeToken lifecycle, placeholder-token rejection, preview-before-posting, confirmation_required behavior, preflight not counting as confirmation, and counterparty scoping. These are exactly the high-stakes write behaviors an agent needs before invoking the 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 core purpose is front-loaded in the first sentence, and the subsequent workflow details are relevant. The prose is dense and somewhat repetitive around token validity and confirmation, but it remains appropriately sized for a 28-parameter destructive creation tool.

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

Completeness3/5

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

It covers the confirmation and routing workflow well, but for a 17-required-parameter invoice creation tool it does not explain how to obtain or validate many required IDs (customer, product, VAT rate, analysis category, book transaction type). No output schema exists, so the description could do more to set expectations about the result and prerequisite lookups.

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?

The description clarifies saleRepId/saleRepCode, routeToken, confirmWrite, and confirmCounterpartyExplicit, but many required fields such as acCode, entryDate, procDate, netAmount, vatRateId, vatPercentage, bookTranTypeId, and analysisCategoryId are left to the schema. With only 57% schema description coverage, the description does not fully compensate for the remaining parameter gaps.

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 states a specific verb and resource: 'Creates a sales invoice' with caller-supplied reference and reconciled product, VAT and Sales-analysis lines. It does not explicitly name or distinguish from close siblings such as brc_create_sales_invoice_gen_ref or brc_batch_sales_invoices, so an agent must infer the boundary.

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?

It gives clear procedural guidance for confirmWrite, routeToken, confirmCounterpartyExplicit, and the sales-rep ID/code pairing, including when code-only input is rejected. It stops short of naming alternative tools or stating when to prefer this tool over the gen_ref or batch invoice variants.

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.