I’m almost ready to release the next version of my ToolBox. A big part of this version is an agentic functionality that will help you build ToolBox scripts. Check out the video and let me know what you think?

In this video, Erik demonstrates a new feature he’s adding to the BCALToolbox: an AI-powered coding agent directly embedded within the toolbox interface. He walks through several practical examples, from simple code explanations to generating Fibonacci sequences and creating Business Central transfer orders from Excel data — all driven by natural language conversation with the agent.
What is the BCALToolbox?
For those unfamiliar, the BCALToolbox is an open-source tool that allows Business Central developers to write a subset of AL code and execute it directly. The interface is straightforward: you write code on the left panel and see output on the right. It’s designed to make your life easier by providing quick, consistent functionality for Dynamics 365 Business Central development.
The workspace is organized as a multi-root VS Code project:
{
"folders": [
{ "path": "app" },
{ "path": "test" },
{ "path": "scripts" },
{ "path": ".github" },
{ "path": ".azureDevOps" }
],
"settings": {
"CRS.ObjectNameSuffix": "TBHLG",
"CRS.OnSaveAlFileAction": "Rename",
"al.compilationOptions": {
"parallel": true
},
"al.enableCodeAnalysis": true,
"al.backgroundCodeAnalysis": true,
"al.codeAnalyzers": [
"${CodeCop}", "${UICop}", "${PerTenantExtensionCop}"
]
}
}
Introducing the Coding Agent
The big addition is a chat-based AI agent integrated directly into the toolbox’s output panel. When you activate the coding agent, the output panel transforms into a conversational chat UI. The agent is context-aware — it understands it’s operating inside the toolbox, knows about the subset of AL that toolbox programs use, and always has access to whatever code is currently in your editor.
LLM Provider Choices
True to Erik’s philosophy of giving users choice, the agent supports multiple large language model providers:
- Azure OpenAI
- ChatGPT (OpenAI directly)
- Anthropic (Claude)
- LM Studio (for running local models)
Erik notes that Microsoft’s own Business Central AI resources may be supported in the future once Microsoft figures out the licensing and access model. For his demonstrations, he uses Claude from Anthropic, which he says has given him the best results for AL code generation so far.
A Note on Streaming
One technical limitation Erik highlights is that because this is built in AL using the HTTP client functionality, streaming responses aren’t supported. The entire reply from the LLM must be received before it can be displayed, so you won’t see the familiar “typing” animation. The current AL HTTP client simply doesn’t support streaming output in a progressive, chunked fashion.
Demo: Simple Code Explanation
Erik starts with the basics. He writes a simple Message('Hello World') program and asks the agent “What does this program do?” The agent correctly identifies it as the most basic toolbox program possible — one that simply displays “Hello World” to the console when you click run.
The agent is helpful enough to proactively suggest next steps, asking if Erik would like to modify it to work with Business Central data or the attached Excel sheet.
Demo: Analyzing Customer Balances
Moving to a more complex example, Erik loads a program that iterates through customer records, calculates balances, finds the largest one, and exports data to Excel. When asked what the program does, the agent provides a thorough breakdown:
- Iterates through customer records
- Calculates each customer’s balance
- Outputs results to the console
- Exports data to an attached Excel sheet
- Has a safety limit that stops processing after 10 customers
- Displays the largest customer balance found
Modifying Code Through Conversation
Erik then asks the agent to “change this so it will output the name of the customer with the largest balance.” The agent generates modified code that adds a new text variable to store the customer name alongside the balance tracking. Rather than manually copying and pasting, Erik simply clicks “Use the code from this reply,” and the program updates automatically. Running it confirms the modification works — it now displays both the largest balance and the corresponding customer name.
Demo: Generating a Fibonacci Sequence
This was apparently the demo that generated buzz on LinkedIn. Erik simply types “Fibonacci” into the agent — nothing else. The agent, being fully context-aware of the toolbox environment, generates a complete Fibonacci sequence program that:
- Calculates Fibonacci numbers
- Outputs them to the console with markdown formatting
- Writes the results to the attached Excel sheet
The program runs successfully on the first try, with nicely formatted markdown output in the chat panel. The Excel sheet also contains the Fibonacci numbers, ready for download.
Demo: Creating Transfer Orders from Natural Language
This is where things get genuinely practical. Erik types: “Create a program that will create a transfer order. Test it with item 1900-S, 10 pieces from West to East inventory location.”
MCP-Style Tool Calls
The agent doesn’t just blindly generate code. It first makes internal MCP (Model Context Protocol) style calls to inspect the environment:
- Show me tables — The agent queries the available Business Central tables to find transfer order-related tables
- Show me fields — It then inspects the fields on the Transfer Header and Transfer Line tables
- Only after gathering this metadata does it generate the actual code
The generated program includes proper functions for creating transfer headers and transfer lines, and it even defaults to using the work date since no date was specified in the prompt. The program runs successfully and creates the transfer order.
Iterating on the Code
Erik then asks the agent to modify the code to use number series (by inserting a blank header to trigger Business Central’s automatic number series assignment). This surfaces a couple of bugs — one in the agent’s UI for applying code changes, and one in the toolbox runtime related to code variables being typed as text. Erik acknowledges these are known issues he needs to fix before release.
Excel-Driven Batch Processing
For the final evolution of this demo, Erik asks the agent to change the program so it reads transfer orders from the Excel sheet, with columns for item number, quantity, from-location, and to-location. The agent generates code that loops through Excel rows, creating a transfer order for each row of data.
After populating the Excel sheet with two test rows and a minor adjustment (changing the start row from 2 to 1 since there were no headers), the program successfully creates two transfer orders with the correct items, quantities, and locations.
Current Limitations and Known Issues
- No streaming responses — AL’s HTTP client doesn’t support chunked/streaming output, so responses appear all at once
- Syntax highlighting — Code blocks in the chat don’t have AL syntax coloring yet; Erik describes this as “actually sort of complicated to do”
- “Use this code” button bugs — There’s an intermittent issue where the button to apply suggested code back to the editor doesn’t work
- Variable type handling — A runtime error with code variables being typed as text needs to be fixed
- Model selection — The final version will include a field to specify which model to use from the selected provider
Summary
The coding agent addition to the BCALToolbox represents a genuinely useful integration of AI into the Business Central development workflow. Rather than switching between an AI chat window and your development environment, the agent lives right inside the toolbox with full context of your code, your Excel data, and the Business Central table metadata. The ability to go from a natural language description to a working program — and then iteratively refine it through conversation — is compelling, especially for common tasks like creating documents, processing data from Excel, or exploring Business Central data structures. Erik is actively seeking community feedback on what additional capabilities would be most valuable, so if you have ideas, now is the time to share them.