Skip to main content
Glama
business-central-mcp

business-central-mcp

by SShadowS

bc_respond_dialog

Destructive

Responds to an open Business Central dialog or confirmation prompt reported by another action, allowing blocked workflows to continue.

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 (bc_run_report's request page included), 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. Each dialog entry says what it is: kind ("confirm", "message", "error", "requestPage", "page"), title, message (the question or text it shows), responses (the answers this dialog accepts; pick one of them) and fields (inputs, same shape as page fields). The result's "closed" says whether BC closed the dialog, and "closedPages" lists pages the answer closed (e.g. "yes" on a discard confirm closes its card): those pageContextIds no longer work. 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, bc_run_report). Do NOT guess the dialogFormId -- always use the exact formId from the dialogsOpened array.

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

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>",
      "dialogFormId": "<dialogFormId>",
      "response": "<response>"
    },
    "name": "bc_respond_dialog"
  }
}

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): a retry with the same key and arguments returns the stored result instead of re-running. See the server instructions.
dialogFormIdYesDialog form ID (formId) from a dialogsOpened entry; a report request page is bc_run_report's first dialogsOpened entry.
pageContextIdYesPage context ID of the page that triggered the dialog.

Output Schema

NameRequiredDescriptionDefault
closedYes
messagesYes
downloadsYes
replaySafeYes
closedPagesYes
openedPagesYes
externalUrisYes
dialogsOpenedYes
changedSectionsYes
requiresDialogResponseYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changedv3.0.0
    • changedInput schema / properties / dialogFormId / description
      Previous value: -"Dialog form ID from a dialogsOpened entry, or requestPage.formId returned by bc_run_report."New value: +"Dialog form ID (formId) from a dialogsOpened entry; a report request page is bc_run_report's first dialogsOpened entry."
    • 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."
    • addedOutput schema / properties / closed
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / closedPages
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • 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"
      +]
    • removedOutput schema / properties / success
      Removed value: -{
      -  "type": "boolean"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "success",
      -  "changedSections",
      -  "dialogsOpened",
      -  "requiresDialogResponse",
      -  "openedPages",
      -  "messages",
      -  "downloads",
      -  "externalUris",
      -  "replaySafe"
      -]New value: +[
      +  "closed",
      +  "closedPages",
      +  "changedSections",
      +  "dialogsOpened",
      +  "requiresDialogResponse",
      +  "openedPages",
      +  "messages",
      +  "downloads",
      +  "externalUris",
      +  "replaySafe"
      +]
  2. 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"
      +]
  3. 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"
      +}
  4. First observedv1.5.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only flag destructive/non-idempotent; the description adds substantive behavior: 'abort' fails with INPUT_VALIDATION_ERROR on dialogs without an Abort button, 'print'/'preview' are required on report request pages that have no OK button, 'ok' matches LookupOk-modeled buttons, and pageContextIds in closedPages stop working. It also discloses chained dialogs, downloads[] with NOT_REPLAYED on operationId replay, and that externalUris are never fetched.

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?

The definition is front-loaded with the trigger condition and hard constraints before the verbose behavioral details, and most sentences carry real information. It loses a point for redundancy: the set of tools that open dialogs is listed twice (first mentioning three, later listing six) and the 'do not call without a preceding dialog' rule is restated in the same paragraph.

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?

Despite an output schema existing, the description still explains the fields an agent must react to (closed, closedPages, changedSections, dialogsOpened, downloads, externalUris) and how to loop through chained dialogs. For a destructive, non-idempotent, state-dependent tool, nothing needed for correct invocation appears missing.

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% and the response enum is already self-documented, so the baseline is 3. The description earns above that by adding edge-case semantics not in the schema: pageContextId may be either the dialog's own page context or the opening page's, and dialogFormId must come from a dialogsOpened entry and must never be guessed. The abort/print/preview caveats partially overlap the enum description, keeping it below 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 first sentence gives a specific verb and resource: responds to an open Business Central dialog or confirmation prompt. It immediately distinguishes the tool from siblings by stating 'This tool only presses a button; it never sets values' and routing field entry to bc_write_data.

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 names the explicit trigger condition (dialogsOpened with requiresDialogResponse: true), lists which tools produce dialogs, and states a hard exclusion ('Do NOT call this without a preceding dialog'). It also names the alternative for the adjacent task (bc_write_data for filling dialog fields) and the sequencing rule (fill fields, then press OK; never press ok over a failed field).

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