DEV Community

Cover image for MCP Server: Data Query Tools Against Dynamic Tool Mode in Dynamics 365 Business Central
Dean Fachrie
Dean Fachrie

Posted on AI-assisted

MCP Server: Data Query Tools Against Dynamic Tool Mode in Dynamics 365 Business Central

Applies to: Dynamics 365 Business Central online, the Business Central MCP server, and an agent in Microsoft Copilot Studio. Tested on version W1 29.0 (platform 29.0.56480.0, application 29.0.54011.56829) in a Business Central online sandbox with the CRONUS International Ltd. demo company, October and November 2026.

CodeCore Dynamics LLC. 10 November 2026.


With data query tools switched on, our Copilot Studio agent gave the stock of the ATHENS Desk in each warehouse in 4 of 5 runs. With only the 3 tools of dynamic tool mode, the agent returned the total in 4 of 5 runs and did not give the split by warehouse in any of the 5 runs.

We asked the same question 10 times on 2 and 3 November 2026, a few days after our webinar on the Business Central MCP server, each time in a new test session: "How much stock of the Athens Desk do we have, and across which warehouses?"

Copilot Studio answer giving 510 units in total and stating that the inventory API does not expose the location
Run 1, without data query tools, 1:00.59: 510 units in total, and no split by warehouse.

Copilot Studio answer listing Main 255, East 110, West 90 and Yellow 55, with the AL query on the Item Ledger Entry table
Run 9, with data query tools, 1:03.71: the same 510 units, split by warehouse.

Tool Setups in Copilot Studio

Both setups used the same agent, connected to the Business Central MCP server with User authentication, and the same MCP server configuration in Business Central, with Dynamic Tool Mode on and Data Query Tools (Preview) activated. We chose the tools in Copilot Studio, on the list of tools of the Business Central MCP server: the 3 tools of dynamic tool mode only, or all 7.

MCP server tool list in Copilot Studio with only bc_actions_search, bc_actions_describe and bc_actions_invoke switched on
Data query tools off: only the 3 tools of dynamic tool mode switched on. For the second setup, we switched on all 7.

In dynamic tool mode, Microsoft Learn describes 3 tools: "the agent uses these standard tools to search for and execute the needed tools from the configuration: bc_actions_search, bc_actions_describe, bc_actions_invoke" (Configure Business Central MCP Server). These tools reach the API pages and API queries that the configuration allows.

Data query tools add 4 more: bc_data_find_tables, bc_data_get_table_schema, bc_data_get_table_relations and bc_data_query. Learn describes the last of these as a tool that "Compiles and validates an AL query. Set returnData to true to run the validated query and return rows." The same page states that "Data query tools are read-only and don't allow agents to create, modify, or delete data" (Configure Business Central MCP Server).

Test Runs

Dynamic tool mode only Time Answer All 7 tools Time Answer
Run 1 1:00.59 Total Run 6 1:16.44 By warehouse
Run 2 1:08.08 Total Run 7 1:01.92 By warehouse
Run 3 0:59.83 Total Run 8 1:09.68 By warehouse
Run 4 0:43.47 Question back Run 9 1:03.71 By warehouse
Run 5 0:56.18 Total Run 10 0:59.29 Item not found
Average 1:01.17 Average 1:07.94
Success 0 of 5 Success 4 of 5

A success is an answer split by warehouse. The averages leave out runs 4 and 10, which ended without an answer.

Every answer by warehouse gave the same split: MAIN 255, EAST 110, WEST 90 and YELLOW 55, which comes to 510 and matches the Items by Location page in Business Central.

Items by Location page for item 1896-S showing EAST 110, MAIN 255, WEST 90 and YELLOW 55
The same split on the Items by Location page in Business Central.

Why Dynamic Tool Mode Gave the Total Only

Without data query tools, the agent searched the API actions with bc_actions_search. The list that came back included List_ItemLedgerEntries_PAG30069, List_Items_PAG30008 and List_Locations_PAG30076. The agent then explained in each answer that the inventory API does not expose the warehouse on the item ledger entries. Learn's itemLedgerEntry resource for API v2.0 lists 14 properties, and none of them is a location (itemLedgerEntry resource type).

With data query tools, the agent wrote an AL query on the Item Ledger Entry table, filtered on item 1896-S, and ran the query with bc_data_query. The table has a Location Code, so the rows came back by warehouse, including 1 row with no location and a quantity of 0.

The Times

The runs with data query tools were not faster: 1:07.94 on average against 1:01.17, from pressing Enter to the end of the answer.

In the webinar on 28 October, we timed 1 run of each: 2:09 without data query tools and 0:51 with them. The repeat runs did not show that difference, so we would not read the webinar times as typical. The difference we saw in 4 of 5 runs was in the answer: without data query tools, the agent could not give the split by warehouse.

Failed Runs

In run 4, bc_actions_search was called without the tool's required ActionType input, and the agent asked What type of action are you interested in searching for? We stopped the clock and did not answer. Before the webinar, the agent had asked the same question in at least 3 other attempts without data query tools.

In run 10, the agent searched the item table for "Athens Desk", the query returned 0 records, and the agent answered that the item could not be found. The item's description in the demo company is ATHENS Desk. We did not investigate the cause further.

Follow-Up Questions in the Webinar

In the webinar, we continued in the same chat with data query tools on.

  • "How many of these units are committed to open sales orders?" The agent returned 6 units on open sales orders.
  • "How many are still available in each warehouse after those orders?" The agent noted that the sales order line for the 6 units had no location, and so did not deduct the 6 units from any warehouse. In Business Central, the Location Code on that line is blank.

Questions from Attendees

Attendees sent their own prompts, which we ran live in the same agent with data query tools on.

Income Statement and Balance Sheet in Excel

An attendee asked for the income statement and balance sheet for 2026 as 1 Excel file. The agent explained that the session had no tool to create an Excel file, and returned both as tables in the chat, built from G/L entries. The income statement from 1 January to 28 October 2026 came to a net credit of £44,748.95 over 11 accounts. The balance sheet listed 14 asset and liability accounts at 28 October, and no equity accounts. Both tables are account listings, not the financial report definitions in Business Central. On the Chart of Accounts page, every net change and balance matched, and the Total Revenue line, -£212,838.95, equals the 4 revenue accounts in the agent's table.

Chart of Accounts with Total Revenue of -212,838.95 and net changes on the cost accounts 7110 to 7190
Net change from 1 January to 28 October 2026 on the Chart of Accounts, as in the agent's table.

Top Customers and a Reconciliation

An attendee asked for the top 10 customers by invoiced sales for the current financial year, and for any differences between invoiced sales, customer ledger amounts and G/L revenue to be explained. The agent read the accounting periods to find that the financial year began on 1 January 2026. Only 5 customers had invoiced sales up to 28 October, across 139 posted invoices.

Customer Invoiced sales excluding VAT
10000 Adatum Corporation £82,919.38
30000 School of Fine Art £68,255.10
40000 Alpine Ski House £29,194.97
20000 Trey Research £28,555.90
50000 Relecloud £24,808.76

At invoice level, the agent found that G/L revenue equals the invoice line amount with the sign reversed: £7,769.80 and -£7,769.80 on invoice 103165. The customer ledger adds VAT, so invoice 103160 has £500.40 excluding VAT and £625.50 in the customer ledger. Invoice 103170 shows £6,936.80 in all 3 places and posts to account 6130, Sales, Retail - Export, which fits an invoice without VAT. The 139 invoices, the 5 totals and the 3 invoices all match Business Central.

Posted Sales Invoices grouped by customer, with the 5 totals boxed in red
Posted sales invoices from 1 January to 28 October 2026 by customer: 25, 33, 25, 35 and 21 invoices, 139 in all.

Sales Forecast and Delivery

An attendee asked for a sales forecast for the next 3 and 6 months for the 2 top-selling items. From posted sales shipments, the agent named 1896-S ATHENS Desk at about 11.1 units a month and 1928-S AMSTERDAM Lamp at about 8.8. The agent multiplied each monthly rate by 3 and 6, so the forecast carries no seasonality or trend.

In the item ledger entries, the 2 items have the most units sold: 234 and 185 over the 21 calendar months from January 2025 to September 2026, which gives the same rates.

Item Ledger Entries of type Sale grouped by item, with 1896-S at -234 and 1928-S at -185
Units sold by item in the item ledger entries. Sales show as negative quantities.

The same attendee then asked about stock, lead times and a likely delivery date.

Item On hand Open sales orders Open purchase orders Available 6-month forecast
1896-S ATHENS Desk 510 6 7 about 504 about 67
1928-S AMSTERDAM Lamp 504 23 0 about 481 about 53

In the agent's answer, available is the stock on hand less the open sales orders, without the 7 units on order. The agent noted that PO 106001 for those 7 units had an expected receipt date of 5 April 2026, and was therefore well overdue, and that neither item has a lead time, a safety lead time or stockkeeping units. The agent expected current demand to be met from stock. The stock, orders and lead times match Business Central.

Prompts and Checking

An attendee remarked in the chat that the results depend on the prompt, and our failed attempts without data query tools support the remark. We would expect a prompt that names the item, the measure and the grouping to give the agent less to search for.

The agent labelled every amount with a dollar sign. The demo company's local currency is GBP: General Ledger Setup shows GBP in LCY Code, and the posted invoices show Total Excl. VAT (GBP). We have written the amounts in pounds. Apart from the dollar sign, every figure we checked matched Business Central.

Learn describes the default configuration as letting agents "discover and read eligible Business Central API pages and API queries that the signed-in user has permission to use" (Configure Business Central MCP Server). We did not test how the user's permissions apply to data query tools. We would suggest checking each answer in Business Central before relying on the agent.

Try the Prompts

These are the prompts from this article, in our wording, each with the page where we checked the answer. The figures in another sandbox will differ from ours.

1. Stock by warehouse

How much stock of the Athens Desk do we have, and across which warehouses?
Enter fullscreen mode Exit fullscreen mode

Check: from the item card for 1896-S, open Items by Location.

2. Open sales orders

How many of these units are committed to open sales orders?
Enter fullscreen mode Exit fullscreen mode

Check: on the item card, select the value in Qty. on Sales Order and read Location Code on each line.

3. Income statement and balance sheet

Give me the income statement and the balance sheet for the current financial year to date.
Enter fullscreen mode Exit fullscreen mode

Check: Tell Me Chart of Accounts. Under Filter totals by, set Date Filter, then read Net Change for the income statement and Balance at Date for the balance sheet.

4. Top customers and a reconciliation

List the top 10 customers by invoiced sales for the current financial year. Use the posted sales invoices, the customer ledger entries and the G/L entries, and explain any differences between them.
Enter fullscreen mode Exit fullscreen mode

Check: Tell Me Posted Sales Invoices, filter Posting Date, turn on Analyse, group by Customer No. and sum Amount. For 1 invoice, select Find entries to open the G/L and customer ledger entries.

5. Sales forecast

For our top 2 selling items, forecast sales for the next 3 and 6 months from the sales history.
Enter fullscreen mode Exit fullscreen mode

Check: Tell Me Item Ledger Entries, filter Entry Type = Sale, turn on Analyse, group by Item No. and sum Quantity. Sales show as negative quantities.

6. Stock, lead times and delivery

For those 2 items, compare the forecast with stock, open orders and lead times, and tell me whether we can deliver on time.
Enter fullscreen mode Exit fullscreen mode

Check: on the item card, read Lead Time Calculation on the Replenishment FastTab and Safety Lead Time on the Planning FastTab, then Tell Me Stockkeeping Units.

Sources

On Method

All tests used a Business Central online sandbox on W1 29.0 (platform 29.0.56480.0, application 29.0.54011.56829) with the CRONUS International Ltd. demo company, and an agent in the Copilot Studio test pane with User authentication and Dynamic Tool Mode on. The 10 timed runs took place on 2 and 3 November 2026, each in a new test session, with the tools chosen on the MCP server's tool list in Copilot Studio. Times were measured with a stopwatch from pressing Enter to the end of the answer, and read from screenshots. In run 3, the prompt was pasted 2 times into 1 message by mistake. The answer was the same as in runs 1, 2 and 5, so we have kept the run. The follow-up and attendee questions were run live in our webinar on 28 October 2026. Attendee prompts are paraphrased and names are left out.

Amounts are in GBP, the company's local currency. On 9 November 2026 we checked the figures in this article in Business Central, on the pages listed under each prompt above. The ATHENS Desk now shows 16 units on sales orders, because a second order line was created on 2 November 2026. On 28 October the figure was 6, as the agent said.

This article was assisted by Claude (Anthropic).

About Author

Dean Fachrie is a Dynamics Functional Analyst at CodeCore Dynamics LLC, working on Microsoft Dynamics 365 architecture and enterprise system design.

Still answering stock or finance questions in Business Central with an Excel export?

We help companies live on Dynamics 365 Finance & Operations and Business Central with custom development, Power BI reporting on Microsoft Fabric, Copilot agents and support after go-live.

Each month we run a webinar on Copilot agents in Dynamics 365. This article follows the session of 28 October 2026 on the MCP server in Business Central 29.

Contact us or connect on LinkedIn for architecture reviews.

Top comments (0)