← Back to blog

How does an AI assistant choose which tool to call?

TL;DR The language model picks the tool, not the integration. It reads your question and the list of tools the MCP server publishes: name, description, parameters and annotations. Ledger Botje decides up front what is in that list (write mode, tool selection per connection, access per company and colleague) and steers the next step with descriptions and responses. A specific question with object, action and administration gives the best tool choice.

You type: "Which invoices of Jansen B.V. are still open?" The assistant first looks up the relation and then fetches the open items. Two tool calls, in the right order, without you naming a tool. Who made that choice? Not Ledger Botje: the language model. But the model picks from what the server shows it, based on what the server tells it. This post explains how that works.

Step 1: the server publishes a list of tools

When connecting, the AI client asks through the Model Context Protocol which tools exist. The Ledger Botje MCP server answers with a list, and every tool in that list has four parts:

PartExampleWhat the model uses it for
Namecashflow_receivables_searchrecognising domain, subject and action
Description"Search and filter receivables by customer code, status or due date…"deciding when the tool fits, and when it does not
ParametersaccountCode, status, limitfilling in the call
AnnotationsreadOnlyHint, destructiveHintjudging whether the tool changes something

The AI client passes that list to the language model, next to your question. So the model sees no code and no database, only these descriptions.

Step 2: what is removed from the list up front

Before the model chooses anything, the server has already decided what is in the list. What is not in it, the model cannot call. That is deliberately where you manage permissions, not in the prompt:

  • Write mode. When writing is turned off in the settings, all tools that change something in Exact Online are missing.
  • Tool selection per connection. You can choose a set of tools per AI client, with a default per administration for clients that connect later.
  • Access per company and per colleague. The administrator decides which tools the company uses and can restrict a colleague further or make them read-only. A layer can only remove tools, never add them.
  • Administrator tools. Tools in a test phase are only visible to administrators.

Tools starting with admin_, such as admin_switch to change administration, always stay available. Copilot Studio uses at most 70 tools per agent, so there a tool selection is not a luxury but a necessity.

Step 3: the model chooses by name and description

Now the model puts your question next to the list. Three things help it.

Consistent naming. Every tool name follows the pattern domain, subject, action: sales_orders_create, financial_reporting_balance_search, accounts_search. A question about "creating an order" naturally lands on the tools that start with sales_orders and end in create.

Descriptions that say when to use a tool and when not to. A good description says not only what a tool does, but also when another tool is the better choice. For example, financial_reporting_balance_search says that searching for the word "revenue" misses accounts and is therefore unsuitable for adding up revenue, that revenue is a credit and therefore negative, and that a dashboard should use groupBy rather than page after page of single rows. Sentences like these steer the model away from a tool that looks right at first sight but gives a wrong answer.

Order in the description. Many tasks need several steps. An entry needs a relation, and an attachment must be uploaded before you can link it. The description names that order, and the model turns it into a sequence of calls. For the Jansen B.V. question that is accounts_search first and then cashflow_receivables_search.

Every tool also has a context parameter, in which the model briefly says why it calls the tool. That goes into the call log, so when something is reported we see not only which tool was chosen, but also why.

Step 4: a write action is followed by a confirmation

The annotations from step 1 say whether a tool only reads (readOnlyHint) and whether it does something irreversible (destructiveHint). AI clients use this to ask for permission on write actions; what that looks like differs per client. For tools with major consequences, the description goes a step further. financial_entries_match (matching entries) asks the model to show the items, amounts and balance first and only call the tool after your approval, because unmatching is only possible in Exact Online itself.

Step 5: the response decides the next step

After a call, the model reads the result and decides again: done, or another tool? The server steers here as well:

  • Empty result. If the broadest search returned nothing, the tool says STOP, so the model does not keep trying variations. With a filter that is too strict, it says which filter you can relax.
  • End of the list. An empty page after the first returns pastEnd: true: paging further makes no sense.
  • Freshness. Reporting tools state how old their figures are, and an incomplete refresh appears as cacheRefresh in the response.
  • Connection. If the connection with Exact Online does not work, the response says what the user needs to do, and that the model should not repeat the call.

So an error is not a dead end but an instruction. That saves calls, and it prevents an assistant from creating an order twice because it thought the first one failed.

How to get the right tool faster

  • Name the object and the action. "Create a sales order for…" works better than "put this in Exact".
  • Name the administration if you have several. The assistant then switches first with admin_switch.
  • Say what is not allowed. "Only look up, change nothing" is a clear boundary for the model. If you want to be sure, turn writing off.
  • Limit the tool selection to what you use. Less choice means less chance of a wrong choice, and in Copilot Studio it is required.
  • Start with a prompt from the prompt library. Those are tested for the right tools and order.
  • Report it when it goes wrong. Ask the assistant to use admin_feedback. With those reports and the context from the log we improve descriptions.

Who decides what

DecisionWho
Which tools are availableLedger Botje, based on subscription, write mode, tool selection and access
What a tool does and when it fitsLedger Botje, through name, description and parameters
Which tool is called, and in which orderthe language model of your AI assistant
Whether a write action goes aheadyou, through the confirmation of the client, and Exact Online itself

All tools with their descriptions are in the tool catalogue. If a connection gets stuck, read troubleshooting the MCP connection.

Frequently asked questions

Who chooses which tool is called, Ledger Botje or the AI assistant?

The AI assistant. The language model in Claude, ChatGPT or Copilot reads your question and the list of available tools, and picks from it. Ledger Botje decides which tools are in that list and what their descriptions say, but makes no choice on behalf of the model.

Why does my AI assistant not see some tools?

Because the server does not publish them. When writing is turned off, all write tools are missing. A tool selection can also apply to the connection or the administration, or access that the administrator set per company or per colleague. Copilot Studio also uses at most 70 tools per agent.

Can an AI assistant change something in Exact Online without my approval?

Every tool states whether it only reads or makes changes. AI clients use that to ask for confirmation on write actions; what that looks like differs per client. Tools with major consequences, such as matching entries or sending an invoice, also ask the model in their description to show a proposal first.

What do I do when the assistant keeps picking the wrong tool?

Make the question more specific: name the object (invoice, order, relation), the action (search, create, update) and, if needed, the administration. Limit the tool selection to what you actually use. And ask the assistant to report it via admin_feedback; we use those reports to improve tool descriptions.

FW
Frank Woutersen is the founder of Ledger Botje and writes about AI, MCP and Exact Online. He helps businesses manage their administration smarter with AI assistants.

Ready to use AI with Exact Online?

Try Ledger Botje for free and discover how AI simplifies your daily work.

Try free