Skip to main content
Glama

Red by Big Red Cloud

Batch Purchases

brc_batch_purchases
Destructive

Processes purchases in a batch using structured generated-reference purchase items. 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.

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_purchases"
  }
}

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 / 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
  2. Changed4 schema fields changed
    • removedInput schema / properties / items / items / additionalProperties
      Removed value: -{}
    • addedInput schema / properties / items / items / properties
      Added value: +{
      +  "item": {
      +    "description": "Structured purchase input matching brc_create_purchase_gen_ref and the batch purchase builder.",
      +    "properties": {
      +      "acCode": {
      +        "description": "Supplier account code.",
      +        "type": "string"
      +      },
      +      "accountCode": {
      +        "description": "Nominal account code for the analysis entry.",
      +        "type": "string"
      +      },
      +      "analysisCategoryId": {
      +        "description": "Purchases analysis category id.",
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      },
      +      "bookTranTypeId": {
      +        "description": "Purchase book transaction type id; use 4.",
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      },
      +      "description": {
      +        "description": "Purchase analysis-line description.",
      +        "type": "string"
      +      },
      +      "entryDate": {
      +        "description": "Purchase entry date in ISO format.",
      +        "type": "string"
      +      },
      +      "netAmount": {
      +        "description": "Net amount before VAT.",
      +        "exclusiveMinimum": 0,
      +        "type": "number"
      +      },
      +      "note": {
      +        "description": "Purchase note.",
      +        "type": "string"
      +      },
      +      "procDate": {
      +        "description": "Purchase processing date in ISO format.",
      +        "type": "string"
      +      },
      +      "supplierId": {
      +        "description": "BRC supplier id.",
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      },
      +      "total": {
      +        "description": "Optional caller-calculated gross total; RED recalculates it.",
      +        "type": "number"
      +      },
      +      "totalNet": {
      +        "description": "Optional caller-calculated net total; RED recalculates it from netAmount.",
      +        "type": "number"
      +      },
      +      "totalVAT": {
      +        "description": "Optional caller-calculated VAT total; RED recalculates it from netAmount and vatPercentage.",
      +        "type": "number"
      +      },
      +      "unpaid": {
      +        "description": "Optional caller-calculated unpaid amount; RED recalculates it.",
      +        "type": "number"
      +      },
      +      "vatPercentage": {
      +        "description": "VAT percentage.",
      +        "type": "number"
      +      },
      +      "vatRateId": {
      +        "description": "BRC VAT rate id.",
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      },
      +      "vatTypeId": {
      +        "description": "Optional purchase VAT type; the current builder emits Domestic VAT type 1.",
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "supplierId",
      +      "acCode",
      +      "bookTranTypeId",
      +      "entryDate",
      +      "procDate",
      +      "description",
      +      "note",
      +      "accountCode",
      +      "analysisCategoryId",
      +      "netAmount",
      +      "vatPercentage",
      +      "vatRateId"
      +    ],
      +    "type": "object"
      +  },
      +  "opCode": {
      +    "const": 1,
      +    "default": 1,
      +    "description": "BRC batch operation code. Use 1 to create a purchase.",
      +    "type": "number"
      +  }
      +}
    • removedInput schema / properties / items / items / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / items / items / required
      Added value: +[
      +  "item"
      +]
  3. 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"
      +]
  4. 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"
      +]
  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. First observed

TDQS

A4.1/5.0
Behavior5/5

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

With destructiveHint=true already declared, the description adds substantial context beyond annotations: per-item result reporting, possible partial success, routeToken lifecycle (valid through lookup/preview/transaction, placeholders invalid), token does not bypass preview, and that preflight is not confirmation. It also discloses scope limits (confirmation scoped to the current counterparty), which is exactly the behavioral detail an agent needs for an irreversible write.

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?

Purpose is front-loaded in the first sentence and each paragraph covers a distinct concern (results, token, confirmation). There is some redundancy around confirmation ('Passing preflight is not confirmation' and repeated token/confirm framing), but overall it is dense rather than wasteful.

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?

Covers the full write workflow for a destructive batch tool: token acquisition validity, preview, explicit confirmation, and partial success, all of which the agent needs to call it safely. It omits guidance on the priceBasis parameter and doesn't hint at how to interpret a partial-failure response, but with no output schema and full schema coverage these are modest gaps.

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 coverage is 100%, so all 8 parameters, including confirmWrite, confirmCounterpartyExplicit and routeToken, are already documented in the schema. The description reinforces the confirmation semantics but adds no new syntax or format info, so the baseline 3 applies. Notably, priceBasis — a useful enum — is not addressed in the description at all.

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 and resource ('Processes purchases in a batch') plus the shape of input ('structured generated-reference purchase items') and that results are per-item with partial success. It doesn't explicitly contrast with the sibling brc_create_purchase or the other batch tools, so sibling differentiation is only implied by the 'batch' qualifier.

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 preconditions and workflow conditions: valid routeToken, preview-before-write, confirmWrite: true only after explicit confirmation, confirmCounterpartyExplicit required. It does not say when to choose this over brc_create_purchase for a single purchase or when a batch is preferred, so alternatives remain unstated.

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.