Skip to main content
Glama
business-central-mcp

business-central-mcp

by SShadowS

bc_execute_action

Destructive

Executes named actions or cue-tile drill-downs on an open Business Central page, returning updated fields, dialogs, and newly opened pages.

Instructions

Executes either a named action OR a cue-tile drill-down on an open page. Pass action for header / line / system actions (Post, Delete, New, Release). Pass cue for Role Center cue tiles to open the underlying list (e.g. cue: "Sales Quotes" with section: "factbox:Activities" opens the Sales Quotes list). Requires a pageContextId from bc_open_page.

For cue drill-down, also pass section: the sectionId of the part that owns the cue, as bc_open_page listed it (Role Center parts are "factbox:", e.g. "factbox:Activities"). The returned openedPages array holds the newly opened list page ({ pageContextId, caption, pageType }).

For a named action: validates the action is enabled, sends the InvokeAction RPC, applies the resulting events, and returns updatedFields (only fields whose value the action changed) / changedSections / dialogsOpened / openedPages / closedPages (pages the action closed, e.g. a posted document; their pageContextIds no longer work).

Use exactly one of "action" or "cue" -- passing both is an error.

If the action triggers a confirmation dialog or modal page, the response includes a dialogsOpened array with the dialog's formId and details. When requiresDialogResponse is true, you must follow up with bc_respond_dialog to confirm or cancel. Each dialogsOpened entry carries its own pageContextId: when the dialog has input fields (listed in its fields array), fill them with bc_write_data against that pageContextId before pressing OK with bc_respond_dialog. Texts the action shows through AL Message() (e.g. "3 documents were sent") come back in messages: [{ text, type }].

Row-scoped actions (Delete, Edit on a list row) require targeting a specific row. Use rowIndex (0-based) or bookmark to specify which row the action applies to. For Document pages, use section to disambiguate between header and line actions (e.g., "Delete" on header deletes the whole document, "Delete" on "lines" deletes one line).

For batch operations across multiple rows (e.g. deleting several lines at once), pass bookmarks (an array) instead of bookmark/rowIndex -- the first entry is the anchor row. Only actions that consume a selection (e.g. Delete) act on all listed rows; current-row-only actions (Edit, View, DrillDown, New) reject bookmarks[] and must use bookmark/rowIndex instead. bookmarks[] is mutually exclusive with bookmark, rowIndex, and cue.

Pass expectedStateVersion (from a prior bc_read_data or bc_open_page stateVersion field) to guard against acting on drifted state. If the page has been mutated by async events or a sibling operation since that read, the call is immediately rejected with code STALE_CONTEXT before touching BC. Re-read with bc_read_data to get the current stateVersion, then retry. Omit expectedStateVersion to skip the check.

Do NOT use this for writing field values -- use bc_write_data. Do NOT use this to open records from a list -- use bc_navigate with drill_down action instead.

Examples:

  • Drill into a cue tile: { "pageContextId": "rc1", "section": "factbox:Activities", "cue": "Sales Quotes" }

  • Post a sales order: { "pageContextId": "so1", "action": "Post" }

  • Delete a row: { "pageContextId": "list1", "action": "Delete", "bookmark": "..." }

  • Create new record: { "pageContextId": "abc", "action": "New" }

  • Delete a document line: { "pageContextId": "abc", "action": "Delete", "section": "lines", "rowIndex": 2 }

  • Delete multiple rows in one call: { "pageContextId": "list1", "action": "Delete", "bookmarks": ["bk1", "bk2"] } -- only selection-consuming actions like Delete act on all listed rows

  • Execute with staleness guard: { "pageContextId": "abc", "action": "Post", "expectedStateVersion": 5 }

If the action produces a file (Open in Excel, Print, export), its bytes appear in downloads[] (an operationId replay returns the metadata with error code NOT_REPLAYED instead of the bytes); links BC would open externally appear in externalUris[] and are never fetched by the server.

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": {
      "pageContextId": "<pageContextId>"
    },
    "name": "bc_execute_action"
  }
}

Input Schema

NameRequiredDescriptionDefault
cueNoCue tile name to drill down on (e.g. "Sales Quotes", "Pending Approvals"). Use with section pointing at the subpage that owns the cuegroup. Use action OR cue, not both.
actionNoAction caption name to execute (case-insensitive). Use action OR cue, not both. Must match a visible, enabled action from bc_open_page response.
sectionNoSection context. Required when using cue; optional for action. Examples: "lines", "factbox:Activities" (a Role Center part, as bc_open_page lists it).
bookmarkNoStable row identifier for row-scoped actions.
rowIndexNo0-based row position for row-scoped actions.
bookmarksNoStable row identifiers for a MULTI-ROW action (batch delete, apply-entries). The first bookmark is the anchor/current row. Mutually exclusive with bookmark, rowIndex, and cue. Bookmarks must come from a bc_read_data of the same section and must still be loaded. Only actions that consume a selection (e.g. Delete) act on all rows; Edit/View/DrillDown/New use the anchor only and are rejected with bookmarks[].
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.
pageContextIdYesPage context ID returned by bc_open_page.
expectedStateVersionNoOpt-in staleness guard. Pass the stateVersion from a prior bc_read_data or bc_open_page response. If the page state has changed since that read (async events or sibling writes mutated it), the call is rejected immediately with code STALE_CONTEXT before touching BC. Omit to skip the check.

Output Schema

NameRequiredDescriptionDefault
dialogNo
successYes
messagesYes
downloadsYes
replaySafeYes
closedPagesYes
openedPagesYes
externalUrisYes
dialogsOpenedYes
updatedFieldsNo
changedSectionsYes
requiresDialogResponseYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields 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."
    • changedInput schema / properties / section / description
      Previous value: -"Section context. Required when using cue; optional for action. Examples: \"lines\", \"subpage:Activities\"."New value: +"Section context. Required when using cue; optional for action. Examples: \"lines\", \"factbox:Activities\" (a Role Center part, as bc_open_page lists it)."
    • addedOutput schema / properties / closedPages
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / dialog / additionalProperties
      Previous value: -{}New value: +false
    • addedOutput schema / properties / dialog / properties / fields
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "editable": {
      +        "type": "boolean"
      +      },
      +      "isLookup": {
      +        "type": "boolean"
      +      },
      +      "lookupCustom": {
      +        "type": "boolean"
      +      },
      +      "name": {
      +        "type": "string"
      +      },
      +      "options": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "text": {
      +              "type": "string"
      +            },
      +            "value": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "text",
      +            "value"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "selectedOption": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "text": {
      +            "type": "string"
      +          },
      +          "value": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "showMandatory": {
      +        "type": "boolean"
      +      },
      +      "tab": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "editable",
      +      "type"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / dialog / properties / kind
      Added value: +{
      +  "enum": [
      +    "confirm",
      +    "message",
      +    "error",
      +    "requestPage",
      +    "page"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / dialog / properties / responses
      Added value: +{
      +  "items": {
      +    "enum": [
      +      "ok",
      +      "cancel",
      +      "yes",
      +      "no",
      +      "abort",
      +      "print",
      +      "preview"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / dialog / properties / title
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / properties / dialog / required
      Previous value: -[
      -  "formId",
      -  "pageContextId"
      -]New value: +[
      +  "pageContextId",
      +  "formId",
      +  "kind",
      +  "responses"
      +]
    • changedOutput schema / properties / dialogsOpened / items / additionalProperties
      Previous value: -{}New value: +false
    • addedOutput schema / properties / dialogsOpened / items / properties / fields
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "editable": {
      +        "type": "boolean"
      +      },
      +      "isLookup": {
      +        "type": "boolean"
      +      },
      +      "lookupCustom": {
      +        "type": "boolean"
      +      },
      +      "name": {
      +        "type": "string"
      +      },
      +      "options": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "text": {
      +              "type": "string"
      +            },
      +            "value": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "text",
      +            "value"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "selectedOption": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "text": {
      +            "type": "string"
      +          },
      +          "value": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "showMandatory": {
      +        "type": "boolean"
      +      },
      +      "tab": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "editable",
      +      "type"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / dialogsOpened / items / properties / kind
      Added value: +{
      +  "enum": [
      +    "confirm",
      +    "message",
      +    "error",
      +    "requestPage",
      +    "page"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / dialogsOpened / items / properties / responses
      Added value: +{
      +  "items": {
      +    "enum": [
      +      "ok",
      +      "cancel",
      +      "yes",
      +      "no",
      +      "abort",
      +      "print",
      +      "preview"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / dialogsOpened / items / properties / title
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / properties / dialogsOpened / items / required
      Previous value: -[
      -  "formId",
      -  "pageContextId"
      -]New value: +[
      +  "pageContextId",
      +  "formId",
      +  "kind",
      +  "responses"
      +]
    • addedOutput schema / properties / openedPages / items / properties / pageType
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / properties / openedPages / items / required
      Previous value: -[
      -  "pageContextId",
      -  "caption"
      -]New value: +[
      +  "pageContextId",
      +  "caption",
      +  "pageType"
      +]
    • changedOutput schema / required
      Previous value: -[
      -  "success",
      -  "changedSections",
      -  "openedPages",
      -  "dialogsOpened",
      -  "requiresDialogResponse",
      -  "messages",
      -  "downloads",
      -  "externalUris",
      -  "replaySafe"
      -]New value: +[
      +  "success",
      +  "changedSections",
      +  "openedPages",
      +  "closedPages",
      +  "dialogsOpened",
      +  "requiresDialogResponse",
      +  "messages",
      +  "downloads",
      +  "externalUris",
      +  "replaySafe"
      +]
  2. Changed2 schema fields changedv2.4.7
    • addedOutput schema / properties / messages
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "text": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "text",
      +      "type"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "success",
      -  "changedSections",
      -  "openedPages",
      -  "dialogsOpened",
      -  "requiresDialogResponse",
      -  "downloads",
      -  "externalUris",
      -  "replaySafe"
      -]New value: +[
      +  "success",
      +  "changedSections",
      +  "openedPages",
      +  "dialogsOpened",
      +  "requiresDialogResponse",
      +  "messages",
      +  "downloads",
      +  "externalUris",
      +  "replaySafe"
      +]
  3. Changed4 schema fields changedv2.3.0
    • addedOutput schema / properties / dialog / properties / pageContextId
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / properties / dialog / required
      Previous value: -[
      -  "formId"
      -]New value: +[
      +  "formId",
      +  "pageContextId"
      +]
    • addedOutput schema / properties / dialogsOpened / items / properties / pageContextId
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / properties / dialogsOpened / items / required
      Previous value: -[
      -  "formId"
      -]New value: +[
      +  "formId",
      +  "pageContextId"
      +]
  4. Changed2 schema fields changedv2.0.0
    • addedInput schema / properties / operationId
      Added value: +{
      +  "description": "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.",
      +  "maxLength": 200,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "changedSections": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "dialog": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "formId": {
      +          "type": "string"
      +        },
      +        "message": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "formId"
      +      ],
      +      "type": "object"
      +    },
      +    "dialogsOpened": {
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "formId": {
      +            "type": "string"
      +          },
      +          "message": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "formId"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "downloads": {
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "contentType": {
      +            "type": "string"
      +          },
      +          "fileName": {
      +            "type": "string"
      +          },
      +          "savedPath": {
      +            "type": "string"
      +          },
      +          "sizeBytes": {
      +            "type": "number"
      +          },
      +          "style": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "fileName",
      +          "contentType",
      +          "sizeBytes",
      +          "style"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "externalUris": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "style": {
      +            "type": "string"
      +          },
      +          "uri": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "uri",
      +          "style"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "openedPages": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "caption": {
      +            "type": "string"
      +          },
      +          "pageContextId": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "pageContextId",
      +          "caption"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "replaySafe": {
      +      "type": "boolean"
      +    },
      +    "requiresDialogResponse": {
      +      "type": "boolean"
      +    },
      +    "success": {
      +      "type": "boolean"
      +    },
      +    "updatedFields": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "name": {
      +            "type": "string"
      +          },
      +          "value": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "name"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "success",
      +    "changedSections",
      +    "openedPages",
      +    "dialogsOpened",
      +    "requiresDialogResponse",
      +    "downloads",
      +    "externalUris",
      +    "replaySafe"
      +  ],
      +  "type": "object"
      +}
  5. First observedv1.5.0

TDQS

A4.8/5.0
Behavior5/5

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

Despite annotations already declaring destructiveHint=true, the description adds substantial behavior: the InvokeAction RPC pipeline, which return arrays are populated, that closedPages pageContextIds become invalid, that confirmation modals surface via dialogsOpened with requiresDialogResponse and must be resolved via bc_respond_dialog, that downloads[] may return NOT_REPLAYED on replay, and that STALE_CONTEXT rejects before touching BC. Nothing here contradicts the annotations.

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?

Front-loaded with the core action-vs-cue distinction, then grouped into readable paragraphs and a worked example list. It is long for a description, and some points are stated twice (action/cue exclusivity, bookmarks[] only working with selection-consuming actions), which is minor waste in an otherwise well-organized definition.

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, 9-parameter, multi-mode tool, the description covers the mutation path, dialog follow-up workflow, batch row semantics, staleness guard, and file/link outputs. With an output schema present it goes beyond the minimum requirement, leaving no obvious gap an agent would need before calling it.

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 the baseline is 3, but the description adds real meaning beyond the schema: which row a bookmarks[] anchor refers to, why current-row-only actions reject bookmarks[], and how section disambiguates header vs. line Delete on Document pages. It largely restates the schema's own mutual-exclusivity notes rather than adding new semantics, which keeps it from a 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?

The opening sentence names the exact verb and the two modes it covers (named action vs. cue-tile drill-down), and subsequent lines separate header/line/system actions from Role Center cue tiles. It is clearly distinguishable from bc_write_data and bc_navigate, both of which are named.

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?

Usage is spelled out with explicit exclusions and alternatives: not for writing field values (use bc_write_data), not for opening records from a list (use bc_navigate drill_down), requires a pageContextId from bc_open_page, and exactly one of action/cue. It also explains when to pass section, bookmark/rowIndex vs. bookmarks[], and when to omit expectedStateVersion.

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