Skip to main content
Glama
business-central-mcp

business-central-mcp

by SShadowS

bc_api_invoke

Destructive

Runs Business Central API write actions: create, modify, delete records, or post documents. Pass the action name and parameters to apply changes with BC's own validation.

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.

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). 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.

Output Schema

NameRequiredDescriptionDefault
resultNo
companyYes
actionNameYes
replaySafeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.4.7

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only say destructiveHint=true, idempotentHint=false. The description adds far more: etag/If-Match preconditions for Modify, the API_ACTION_ERROR 'Request_EntityChanged' refusal mode, the guarantee that a rejected call changes nothing, return shapes per action type, permission gating via BC's MCP Server Configuration, and replay/operationId TTL behavior. Nothing here contradicts the annotations — the idempotentHint=false is consistent with the stated fact that a repeat Create or bound action would apply again.

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?

Purpose and workflow are front-loaded, but the operationId/replaySafe/TTL material is long and repeats almost verbatim what the operationId schema description already states, and the 'When NOT to use' clause is buried at the end. Roughly a third of the text is duplicated structured data.

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, nested-parameter, multi-mode write tool this covers everything an agent needs: required discovery steps, per-action parameter shapes, error semantics, permission prerequisites, retry/idempotency rules, and the environment constraint (BC 29+ MCP server, no web-client session). Return values are also characterized despite an output schema existing.

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 coverage is 100%, so baseline is 3, but the description adds real workflow meaning: where actionName must come from (bc_api_search), where the If-Match etag must be read (bc_api_list), and what the parameters object must contain per action family. It largely mirrors the schema's own parameters description, so it earns 4 rather than 5.

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?

Names a specific verb (runs/invokes) and resource (Business Central API action) and immediately enumerates the concrete action families: Create_* (insert), Modify_* (update), Delete_* (delete), bound/unbound actions such as posting. It also separates itself from bc_api_list, which the agent could otherwise confuse with the same API surface.

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 explicit prerequisites (get the action name from bc_api_search, parameters from bc_api_describe), explicit exclusions ('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)'), and names each alternative. Retry guidance (pass operationId) is also stated conditionally.

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