Skip to main content
Glama
EdwardHayes91

business-central-mcp

bc_write_data

Write field values to an open Business Central page, targeting header or line items, and receive server-confirmed results after validation.

Instructions

Writes one or more field values on an already-open Business Central page. Pass a fields object with caption-name keys and string values. BC validates each field and returns the server-confirmed value, which may differ from input due to formatting, auto-completion, or lookups (e.g., entering a partial customer name resolves to the full match). Requires a pageContextId from bc_open_page.

Fields must be editable -- writing to a read-only field returns an error. Write related fields together in one call (e.g., quantity and unit price), but avoid writing unrelated groups together because BC validation cascades may change dependent fields in unexpected order. Check the returned confirmed values to see what BC actually stored.

For Document page line items (Sales Order lines, Purchase Order lines), specify section: "lines" to write to the lines repeater. Use rowIndex (0-based row position) or bookmark (stable row identifier from bc_read_data results) to target a specific line. Prefer bookmark over rowIndex when rows may have been reordered or inserted since the last read.

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 triggering actions like Post, Delete, or Release -- use bc_execute_action instead. Do NOT use this for navigating to records -- use bc_navigate instead.

Examples:

  • Write to Card header: { "pageContextId": "abc", "fields": { "Name": "Contoso Ltd", "Address": "123 Main St" } }

  • Write to Sales Order line: { "pageContextId": "abc", "section": "lines", "rowIndex": 0, "fields": { "Quantity": "5", "Unit Price": "100" } }

  • Write with bookmark targeting: { "pageContextId": "abc", "section": "lines", "bookmark": "XXXX", "fields": { "Description": "Consulting Services" } }

  • Write with staleness guard: { "pageContextId": "abc", "fields": { "Name": "Contoso" }, "expectedStateVersion": 3 }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsYesKey-value pairs of field caption names and string values to write (e.g., { "Name": "Contoso", "City": "London" }).
sectionNoSection to write to (e.g., "lines" for document line items). Omit for header fields.
bookmarkNoStable row identifier from bc_read_data results. Preferred over rowIndex when rows may be reordered.
rowIndexNo0-based row position in the repeater to write to. Use for line items. Prefer bookmark for stability.
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.
Behavior5/5

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

No annotations are provided, so the description fully carries the burden. It discloses that BC validates fields and returns server-confirmed values that may differ due to formatting, auto-completion, or lookups. It also explains error conditions (read-only fields), cascading validation behavior, and the STALE_CONTEXT rejection mechanism with expectedStateVersion. This is deeply transparent about side effects and edge cases.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Despite being lengthy, every sentence earns its place. The structure is logical: core behavior, caveats, targeting options, staleness guard, exclusions, and examples. The front-loaded purpose sentence immediately orients the agent, and the examples are compact and varied. No redundant filler is present.

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?

Given the tool's complexity—6 parameters, nested objects, line targeting, staleness guard, and error modes—the description covers all necessary context. It explains return values (confirmed values), error cases, and operational nuances. There is no output schema, but the description adequately covers what the agent needs to know. The exclusions and alternatives are also fully addressed.

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?

The input schema already covers all 6 parameters with 100% description coverage, so the baseline is 3. The description adds value through concrete examples (card, line, bookmark, staleness guard) and clarifies the fields object structure and the meaning of rowIndex vs bookmark. It reinforces and extends schema details, but does not introduce entirely new semantics, hence a 4.

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 description immediately states a specific verb and resource: 'Writes one or more field values on an already-open Business Central page.' It clearly differentiates from siblings by explicitly excluding actions (bc_execute_action) and navigation (bc_navigate). The scope is precise and unambiguous.

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?

Provides explicit when-to-use guidance: write field values, write related fields together, use bookmark over rowIndex when rows may be reordered. Also gives direct exclusions: 'Do NOT use this for triggering actions... use bc_execute_action instead' and 'Do NOT use this for navigating... use bc_navigate instead.' This level of alternative guidance is exemplary.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EdwardHayes91/Business-Central-Mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server