What looks wrong?

We say this article was researched and checked. If it is wrong, we want the counter-example.

Skip to content
Automation software

What Is Tool Calling? How AI Agents Use Tools in 2026

Tool calling allows language models to execute specific software functions and interact with external databases directly.

Covers self-hosted automation under data-sovereignty constraints: offline Kubernetes, air-gapped testing, and procurement-cycle realities.

ContributorSeptember 23, 202613 min read

This article was researched and fact-checked by an advanced research system.

Tool calling represents the transition from an LLM producing human-readable prose to an LLM generating machine-executable commands.

In the "AI as Writer" paradigm, which remains a core component for platforms like Activepieces that bridge the gap between logic and language, the model predicts the next token to complete a sentence.

Tool calling is the technical capability that allows a large language model to interface with external systems by translating natural language prompts into structured, machine-executable instructions for specific software functions.

In the "AI as Operator" paradigm, the model predicts the specific arguments required to trigger a function. This distinction is visible in the underlying data structure of the interaction.

The following diagram contrasts these two states, showing the move from unstructured natural language to the rigid schema required for programmatic control.

What AI Tool Calling Means for Automated Business Workflows

This structural change transforms the LLM from a closed-loop creative assistant into a component of a larger technical stack.

By adopting this role, the model interacts with the world through Activepieces, an MIT-licensed AI automation platform that translates these digital intents into specific software actions across a company's own apps and data.

Why JSON is the language of tool calls

JSON is the standard medium for tool calling because its rigid syntax allows middleware to parse and validate AI intent before it reaches a production API.

Unlike natural language, a JSON object requires specific keys and value types. This format ensures an LLM cannot "hallucinate" interaction methods; it must conform to the developer's schema or fail at the validation layer.

A physical mold with specific geometric cutouts (circles, squares, triangles) placed over a conveyor belt.

The difference between a prompt and a call

A prompt is a request for information that ends in a display. A tool call is a request for a state change that results in a side effect.

The process begins when you provide a natural language objective. The LLM identifies that the objective requires external data or action and outputs a structured payload instead of a conversational reply.

The middleware validates this payload against the allowed API documentation. Finally, the system executes the command and returns the result to the LLM to inform the next step.

Everything below works on Activepieces' free plan. Start without code or a credit card.

Structural accuracy failures in JSON schema formatting

When a model understands a request perfectly but fails to format the specific JSON schema required by a downstream API, structural accuracy fails. A single misplaced comma terminates the process.

How workflow orchestrators track multi-step execution state

To implement a workflow orchestrator, you must build a centralized state management system that tracks the progress of a multi-step execution. This layer ensures that if a tool call fails, the system knows exactly which variables were set and which actions remain pending.

A large, multi-dial control panel where one dial is glowing, indicating exactly which stage of a complex mechanism is…

You also need standardized execution environments, such as isolated containers or serverless functions, to run the code triggered by the AI. These environments must include robust retry logic to handle transient network errors.

Structural match rate for AI tool calls

80.63 percent is the rate at which research from the College of William & Mary puts this structural match. This means nearly one in five calls fails to execute because the syntax doesn't match the technical specification.

This gap exists because general reasoning doesn't equate to technical precision. To mitigate this, you must choose an architecture that balances speed against the necessity of pre-execution validation.

Architecture Latency Reliability Audit Capability
Direct LLM-to-API Low Low No Audit
Middleware Proxy Medium High Partial Audit
Workflow Orchestrator High Very High Full Audit

As you move toward the Workflow Orchestrator model, you trade immediate response times for the audit trails required by compliance officers to verify every outbound packet.

Component accuracy rate in AI tool operators

It's rarely a total system collapse when an operator fails. It's usually a failure in component accuracy, which the College of William & Mary measures at 88 percent, leaving a significant margin for error in system reliability.

This 12 percent failure rate implies that even if the connection is successful, the specific data passed is incorrect, so the downstream application will process corrupted information. This leads to "silent failures" where the database updates with corrupted information without triggering alerts.

Output quality rate for automated tool operators

The same College of William & Mary study defines a successful operator by its ability to maintain high output quality, which currently reaches 92 percent in controlled environments, meaning nearly one in ten units produced fails to meet the established standard.

8 percent of the remaining output fails to meet operational standards. To ensure success, you must verify that the structural match exceeds 80 percent so the middleware doesn't reject the majority of requests.

You must validate component accuracy against a known schema to prevent the 12 percent of erroneous data points from reaching the production database. Finally, you must log the final output quality to ensure the reasoning remains coherent after applying technical constraints.

Performance metrics for automated workflows

Why AI tool calls fail in production workflows

Reliability drops when the model transitions from generating natural language to generating structured code. While a human reader can infer meaning from a typo, a database requires exact syntax.

The three primary tool call failure modes are hallucinated parameters, schema mismatches, and timeout loops. Identifying these failure modes allows you to build defensive wrappers that treat every model output as an unverified suggestion.

While a human reader can infer meaning from a typo, a database requires exact syntax.

AI hallucinating invalid API parameters

Because they're predicting the most likely next token, models often invent arguments that don't exist in the current library version.

When a model adds a "priority" field to a ticketing system API that only accepts "status," the server rejects the entire request. Providing three specific examples of correct calls (Few-Shot prompting) reduces the likelihood of the model injecting creative but invalid parameters.

A completed flow run showing trigger and step execution with HTTP request details and success status

When third-party API schemas change unexpectedly

When the underlying API documentation changes but the model’s context window remains populated with outdated definitions, tool calls fail.

If a payment processor updates its endpoint to require an ISO-4217 currency code instead of a full country name, the model will continue sending the old format until you manually update the system prompt.

AI agent configuration screen for SEO Blog Writer agent showing instructions, tools section, and structured output settings.

The operator must synchronize the model’s instructions with the live API environment to avoid constant 400-level error responses.

Preventing infinite retry loops in tool calls

Without a hard limit on execution attempts, a model will often enter a loop where it tries to fix a rejected tool call by repeating the same invalid logic.

To prevent this, your middleware must implement a circuit breaker that terminates the session after a set number of failed attempts.

Easier to see it running than to read about it: set it up free, no card.

Security risks of unconstrained AI tool access

The 'Confused Deputy' problem in AI agents

Unconstrained tool access allows a prompt to hijack the agent’s identity, turning the LLM into a proxy that executes unauthorized commands with the system's elevated permissions.

To mitigate this, your middleware must implement a 4-step 'Safe Execution' sequence to scrub and verify every intent before the system grants access to the underlying API. The sequence includes a prompt injection scan, schema validation, middleware credential injection, and execution logging.

By moving credential management away from the LLM and into the middleware, the system ensures that the model never handles the raw tokens required to finalize a transaction.

Data exfiltration via malicious tool parameters

By tricking the agent into passing sensitive data into the parameters of an innocuous-looking "Search" or "Log" function, malicious actors exploit tool calling.

If an agent has access to a public-facing communication tool, the system can instruct it to summarize a private document and send that summary to an external URL. This turns a productivity feature into a data leak vector.

A heavy stone wall with a small, ornate mail slot.

Human-in-the-loop approval for sensitive AI actions

For high-stakes actions like deleting production data or moving money, the system should be configured to pause for a human approval step. This Human-in-the-loop (HITL) requirement ensures that the middleware validates the technical schema while a person validates the business intent.

How Activepieces manages tool call reliability

Activepieces provides the per-project MCP server that allows an agent to reach any of its 735+ integrations as a tool schema, preventing an LLM from sending malformed requests directly to external services by intercepting every intent within a predefined workflow.

A workflow with a loop that iterates through items, retrieving storage data, querying an LLM, and writing results back to…

Every connector registered in the Integrations Framework is immediately available as a tool to an agent, with no secondary integration step required.

The same integration action that runs in a deterministic flow is exposed as an MCP tool, allowing an agent to call it via the Activepieces per-project MCP server.

This mechanism, visible in the packages/integrations directory of the open source repo, ensures that a catalog of 735+ integrations is ready for an LLM to use without manual schema mapping.

Validating LLM outputs against strict schemas

By mapping LLM outputs to rigid, pre-built connector fields rather than allowing the model to generate raw HTTP requests, the middleware enforces data integrity.

When a model attempts to trigger a function, Activepieces validates the payload against the specific schema required by the target service, a process that manages the 735+ integrations available to the agent.

Because the model interacts with a defined interface, the risk of "hallucinated" parameters is effectively neutralized.

Centralized credential management for AI agents

Security is maintained by storing API keys and OAuth tokens within the Activepieces environment, ensuring the LLM never has visibility into the authentication layer.

The model is granted permission to "call" a tool, but it's never passed the bearer token required to execute that tool, a security model used in production by companies like FundingSocieties and Alan.

Visualizing the execution trace of every call

Every interaction is logged in a granular execution trace, allowing you to see exactly where a model’s intent diverged from the required schema.

A failed run is an immediate audit trail that prevents silent failures from corrupting downstream data.

Activepieces provides a per-step agent decision trace in its Run Details UI, which can be exported as event streams via the audit logs and event-streaming feature to ensure an agent's reasoning is audited alongside fixed workflow steps, providing the same observability for agents that MoneyGram and Moneypenny use for their deterministic flows.

Activepieces workflow builder showing a three-step automation flow with Google Calendar trigger and Gmail email action…

The Monday morning tool call implementation checklist

Reliability in autonomous workflows isn't a byproduct of model intelligence but a result of the constraints placed upon the model’s output window.

Define strict JSON schemas for every tool

By forcing the model to adhere to specific data types and required fields before the request ever leaves the application layer, strict JSON schemas act as the primary firewall.

Reliability in autonomous workflows isn't a byproduct of model intelligence but a result of the constraints placed upon the model’s output window.

Using the additionalProperties: false flag in the schema definition ensures the model can't inject extraneous, unhandled keys that could lead to unpredictable behavior in downstream functions.

Set up a dedicated API proxy for logging

Capturing the raw request and response cycles between the AI and third-party services, a dedicated API proxy is the central audit point.

This architectural layer enables PII masking to prevent sensitive customer data from being stored in plaintext logs. Because this proxy sits between the model and the internet, it provides the only reliable way to enforce rate limits.

Implement a 'dry run' mode for testing intent

A 'dry run' mode allows the system to validate the model’s intent against the middleware logic without executing the final write command to the production environment.

Organizations like MoneyGram and Moneypenny run Activepieces in production to maintain this level of control over their automated environments.

Frequently asked questions about AI tool calling

Does tool calling increase LLM token costs?

Because the model must process the technical definitions of every available function alongside the user prompt, tool calling increases token consumption.

Including a library of several dozen tools adds a significant overhead to the input context. To manage these expenses, you should filter the toolset so only relevant functions are sent to the model for a specific task.

You should use shorter, compressed descriptions for function parameters to reduce the input character count. Finally, you should implement a routing layer that classifies the intent before the model sees the full API schema.

Which LLMs support the best tool calling performance?

The most reliable tool calling performance is found in models that have been fine-tuned on specific functional-calling datasets rather than general conversational data.

Models lacking this specific tuning often suffer from "hallucinated arguments." In these cases, the AI invents parameters that don't exist in the source code, causing the execution to fail during the validation phase.

In restricted environments where data can't leave the local network, small-scale open models often require extensive prompt engineering to reach the same level of structural accuracy that larger, hosted models provide out of the box.

Can I use tool calls with legacy software that has no API?

By using a wrapper service that translates the model’s structured JSON output into UI automation commands or direct database queries, tool calling can interface with legacy systems.

Since the AI can't "click" a button in a 20-year-old terminal emulator, the middleware must act as a bridge. The middleware receives the structured intent from the LLM and maps that intent to a specific script or robotic process automation (RPA) sequence.

Finally, the system executes the sequence on the legacy machine and returns the scrape-able text as a result.

Share

Get started

Automate this without code.

Cloud or your own servers.

Start free Talk to sales