Skip to main content
Glama
business-central-mcp

business-central-mcp

by SShadowS

bc_api_invoke

Destructive

Run Business Central API data-changing actions—create, update, delete records, or post documents—using action parameters from search/describe, with optional idempotency keys for safe retries.

Instructions

Runs a Business Central API action that changes data: Create_* (insert a record), Modify_* (update one), Delete_* (delete one), or a bound/unbound action such as posting a document. Get the action name from bc_api_search and its exact parameters from bc_api_describe, then pass them as the "parameters" object. Create and Modify return the record as BC saved it, including its new "@odata.etag"; Delete returns no result.

Modify needs the record's key ("id") and "If-Match" set to its current "@odata.etag" (read it with bc_api_list); a stale etag is refused with API_ACTION_ERROR "Request_EntityChanged" — re-read and retry. BC applies its own validation and business logic; a rejection is API_ACTION_ERROR with BC's message and nothing is changed. Write actions exist only for API objects an admin enabled with those permissions in BC's MCP Server Configuration.

Pass an operationId to make a retry safe: the same id replays the first result instead of running the action again. replaySafe is true for Modify and Delete (a repeat is refused by BC: stale etag, or record gone) and false for Create and bound actions (a repeat would create or post again). When NOT to use: to read (bc_api_list), or for changes that need the UI's dialogs and pages (bc_open_page, bc_write_data, bc_execute_action). Runs on BC's own MCP server (BC 29+); needs no web-client session.

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": {
      "actionName": "<actionName>",
      "parameters": "<parameters>"
    },
    "name": "bc_api_invoke"
  }
}

Input Schema

NameRequiredDescriptionDefault
companyNoCompany to run in (exact, case-sensitive name from bc_list_companies). Defaults to the current session company, then BC_ODATA_COMPANY, then the user's default company in BC.
actionNameYesA Create_*, Modify_*, Delete_* or bound/unbound action name from bc_api_search. List_* actions go through bc_api_list.
parametersYesThe action's parameters as an object, exactly as bc_api_describe's schema names them. Create: the field values, e.g. { "displayName": "Contoso" }. Modify: the key ("id"), "If-Match" with the record's current "@odata.etag" (from bc_api_list), and the fields to change. Delete: the key. Bound action: the key plus the action's own parameters.
operationIdNoOptional idempotency key (e.g. a UUID you generate): a retry with the same key and arguments returns the stored result instead of re-running. See the server instructions.

Output Schema

NameRequiredDescriptionDefault
resultNo
companyYes
actionNameYes
replaySafeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.0.0
    • changedInput schema / properties / operationId / description
      Previous value: -"Optional idempotency key (e.g. a UUID you generate). Retrying with the same operationId and the same arguments returns the first call's stored result instead of running the change again, so a retry after a dropped connection or timeout cannot double-post. Reusing it with different arguments is rejected (OPERATION_ID_REUSED). If the first call's outcome is unknown, the retry returns OPERATION_IN_DOUBT: check the record's state before acting again under a new operationId. Every result of this tool carries replaySafe: true means BC's response proved that re-running the same call (even under a new operationId, after an unknown outcome) cannot apply the change twice -- the write was echoed as an absolute value, or the form it acted on is closed so BC rejects a re-run; false means a re-run may double-apply or nothing proved otherwise, so read the record back before retrying. Replay is time-limited: a completed entry is kept for BC_OPERATION_TTL (default 24h), after which the same operationId runs the call again; check with bc_get_operation before a late retry. A replayed result carries download metadata (fileName, contentType, sizeBytes, savedPath) but not the file bytes."New value: +"Optional idempotency key (e.g. a UUID you generate): a retry with the same key and arguments returns the stored result instead of re-running. See the server instructions."
  2. Addedv2.4.7

TDQS

A4.4/5.0
Behavior4/5

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

Far beyond the annotations: it discloses return shapes per action type (Create/Modify return the record with a new @odata.etag, Delete returns nothing), the If-Match/stale-etag refusal with the specific error name 'Request_EntityChanged' and re-read-and-retry guidance, and that BC validation failures surface as API_ACTION_ERROR with nothing changed. It also explains the operationId replay contract and which action types are replaySafe, which substantially qualifies the idempotentHint=false / destructiveHint=true annotations rather than contradicting them. Only minor gap: no mention of batching or size/perf characteristics.

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 and the discovery-then-invoke workflow are front-loaded, and the paragraphing separates purpose, etag/retry mechanics, idempotency, and exclusions. It is dense and long for a four-parameter tool, with some repetition between the description and the schema on Modify/If-Match, but no sentence is irrelevant.

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, open-world-flagged mutation with nested parameters, the definition covers prerequisites (admin-enabled API permissions, BC 29+, no web-client session needed), error semantics, concurrency control via etags, and safe-retry strategy. An output schema exists and the description still summarizes return values per action type, leaving nothing material for an agent to guess.

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 description coverage is 100% and the schema already documents company, actionName, the per-action contents of 'parameters', and operationId in comparable detail, so the description largely restates structured data. It adds a small amount of routing meaning (actionName must come from bc_api_search, List_* goes to bc_api_list) but no new syntax or format detail beyond the schema.

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?

Opens with a specific verb and resource — 'Runs a Business Central API action that changes data' — and immediately enumerates the action families (Create_*, Modify_*, Delete_*, bound/unbound actions like posting). It explicitly distinguishes itself from bc_api_list (reads), bc_open_page/bc_write_data/bc_execute_action (UI-dependent changes), and bc_api_search/bc_api_describe (discovery), so an agent can pick it without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit workflow (get the action name from bc_api_search, exact parameters from bc_api_describe, then pass them in 'parameters') plus a dedicated 'When NOT to use' clause naming the correct sibling for each excluded case. It also states the precondition that write actions only exist for API objects an admin enabled with those permissions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.