Skip to main content
Glama
business-central-mcp

business-central-mcp

by SShadowS

bc_respond_dialog

Destructive

Answers Business Central confirmation prompts, validation warnings, or report request pages so blocked workflows can continue. Press OK, Yes, No, Cancel, Print, or Preview using the dialog form ID from the triggering tool's response.

Instructions

Responds to an open Business Central dialog or confirmation prompt. Dialogs are triggered by bc_execute_action, bc_write_data, or bc_run_report when BC requires user input (e.g., "Do you want to post?", "Delete this record?", validation warnings, or a report request page). When those tools return a dialogsOpened array with requiresDialogResponse: true, or bc_run_report returns a requestPage, you MUST call this tool (response: "ok" for a report request page) to continue the workflow.

The dialogFormId comes from the dialogsOpened array in the triggering tool's response. The response parameter accepts: "ok" (confirm/accept), "cancel" (dismiss/abort), "yes" or "no" (answer a yes/no question), "abort" (only for a dialog that shows an Abort button; on any other dialog BC ignores it and the call fails with INPUT_VALIDATION_ERROR, the dialog still open), "close" (close a modal information page), or "print" / "preview" (press Print or Preview on a report request page that an action opened, e.g. Print... on a posted document: it has no OK button, so "ok" does nothing there). The tool presses the dialog's own button for the response (e.g. "ok" also matches a page's OK that BC models as LookupOk). Choose the response that matches the dialog's intent -- confirmation dialogs typically need "yes", acceptance dialogs need "ok".

After responding, check the changedSections array in the result to see which page sections were affected. For example, posting a Sales Order may change all sections. If the dialog response triggers another dialog (chained confirmations), the response will include a new dialogsOpened array -- respond to each dialog in sequence.

Do NOT call this without a preceding dialog -- there is no dialog to respond to unless a tool returned dialogsOpened (bc_execute_action, bc_write_data, bc_wizard_navigate, bc_respond_dialog, bc_close_page, bc_upload_file), or a requestPage was returned by bc_run_report. Do NOT guess the dialogFormId -- always use the exact value from the dialogsOpened array (or requestPage.formId).

This tool only presses a button; it never sets values. To fill a dialog's input fields (e.g. a request page or a dialog with entry fields), call bc_write_data with the pageContextId from the dialogsOpened entry or requestPage (bc_run_report) -- that is the dialog's own page context -- and then call this tool to press OK. If a write fails, fix it or cancel the dialog; do not press "ok" over a failed field. Pass either that dialog pageContextId or the opening page's; changedSections and openedPages always describe the opening page.

Example: { "pageContextId": "abc", "dialogFormId": "dialog-123", "response": "yes" }

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.

Input Schema

NameRequiredDescriptionDefault
responseYes"ok" confirms, "cancel" dismisses, "yes"/"no" answers a question, "abort" force-closes, "close" closes a modal info page, "print"/"preview" press the Print or Preview button of a report request page.
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.
dialogFormIdYesDialog form ID from a dialogsOpened entry, or requestPage.formId returned by bc_run_report.
pageContextIdYesPage context ID of the page that triggered the dialog.

Output Schema

NameRequiredDescriptionDefault
successYes
messagesYes
downloadsYes
replaySafeYes
openedPagesYes
externalUrisYes
dialogsOpenedYes
changedSectionsYes
requiresDialogResponseYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv2.4.7
    • changedInput schema / properties / dialogFormId / description
      Previous value: -"Dialog form ID from the dialogsOpened array returned by bc_execute_action or bc_write_data, or requestPage.formId returned by bc_run_report."New value: +"Dialog form ID from a dialogsOpened entry, or requestPage.formId returned by bc_run_report."
    • changedInput schema / properties / response / description
      Previous value: -"\"ok\" confirms, \"cancel\" dismisses, \"yes\"/\"no\" answers a question, \"abort\" force-closes, \"close\" closes a modal info page."New value: +"\"ok\" confirms, \"cancel\" dismisses, \"yes\"/\"no\" answers a question, \"abort\" force-closes, \"close\" closes a modal info page, \"print\"/\"preview\" press the Print or Preview button of a report request page."
    • changedInput schema / properties / response / enum
      Previous value: -[
      -  "ok",
      -  "cancel",
      -  "yes",
      -  "no",
      -  "abort",
      -  "close"
      -]New value: +[
      +  "ok",
      +  "cancel",
      +  "yes",
      +  "no",
      +  "abort",
      +  "close",
      +  "print",
      +  "preview"
      +]
    • addedOutput schema / properties / dialogsOpened / items / properties / pageContextId
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / properties / dialogsOpened / items / required
      Previous value: -[
      -  "formId"
      -]New value: +[
      +  "formId",
      +  "pageContextId"
      +]
    • 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",
      -  "dialogsOpened",
      -  "requiresDialogResponse",
      -  "openedPages",
      -  "downloads",
      -  "externalUris",
      -  "replaySafe"
      -]New value: +[
      +  "success",
      +  "changedSections",
      +  "dialogsOpened",
      +  "requiresDialogResponse",
      +  "openedPages",
      +  "messages",
      +  "downloads",
      +  "externalUris",
      +  "replaySafe"
      +]
  2. 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"
      +    },
      +    "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"
      +    }
      +  },
      +  "required": [
      +    "success",
      +    "changedSections",
      +    "dialogsOpened",
      +    "requiresDialogResponse",
      +    "openedPages",
      +    "downloads",
      +    "externalUris",
      +    "replaySafe"
      +  ],
      +  "type": "object"
      +}
  3. First observedv1.5.0

TDQS

A4.8/5.0
Behavior5/5

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

The annotations (destructiveHint: true, readOnlyHint: false, idempotentHint: false) only give a coarse safety profile, and the description adds substantial specifics beyond that: abort fails with INPUT_VALIDATION_ERROR on dialogs without an Abort button, print/preview is needed on request pages that have no OK button, pressing ok over a failed field write is discouraged, and changedSections/openedPages always describe the opening page. The operationId/replaySafe explanation and downloads/externalUris behavior further clarify side effects and failure modes.

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?

It is front-loaded with purpose and the mandatory-call rule, and nearly every sentence carries operational information. It is long and somewhat dense in paragraph form, with a little overlap between the description and the enum's own description of abort, but no sentence is pure filler.

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 mutating, workflow-critical tool with a rich schema and an output schema, the description covers prerequisites, sequencing, failure modes, and what to inspect afterward (changedSections, new dialogsOpened, downloads). An agent has everything needed to invoke it correctly in the dialog workflow.

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: dialogFormId must come from dialogsOpened or requestPage.formId and must never be guessed, pageContextId may be either the dialog's own context or the opening page's, and response semantics are qualified by dialog type (abort only where an Abort button exists, print/preview only on report request pages).

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 first sentence states a specific verb and resource: respond to an open Business Central dialog or confirmation prompt. It immediately names the three sibling tools that create dialogs (bc_execute_action, bc_write_data, bc_run_report), so an agent can tell this apart from its siblings without reading 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?

It gives an explicit trigger (dialogsOpened with requiresDialogResponse: true, or a requestPage from bc_run_report), an explicit prohibition ("Do NOT call this without a preceding dialog"), and a named alternative for the adjacent task (bc_write_data to fill dialog fields before pressing OK). It even covers chained dialogs and the ordering requirement.

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