Brief IA
›

AI Agents: Five Ways to Call Tools Without MCP

AI Tools·Tom Levy·

AI Agents: Five Ways to Call Tools Without MCP

AI Agents: Five Ways to Call Tools Without MCP
Key Takeaways
1Five integration modes allow for connecting tools without MCP, based on the components already available.
2PydanticAI generates schemas and validates arguments, but business permissions still need to be managed.
3MCP also works locally with stdio, without a mandated network service.
Why it matters : changing the connection mode alters the executor, not the controls that the application must ensure.

Five integration modes allow for connecting an AI agent to a function without an MCP, depending on the existing software components. Native calls, typed functions, REST adapters, subprocesses, or webhooks are not competing standards. Their simplicity depends on the additional work they impose on the team, without exempting them from application controls.

PydanticAI Validates Arguments, Not Permissions

With PydanticAI, the schema presented to the model is derived from the Python signature and the associated documentation of the function. The framework ensures tool registration as well as argument validation; @agent.tool_plain is used when no execution context is needed. In the demonstration, the resulting schema also includes additionalProperties: false.

However, the choice between converting and rejecting arguments deserves explicit tuning. Pydantic typically attempts a conversion when possible; in the strict mode demonstration, the value 17 is rejected for a field requiring a string. The code also transforms a ValueError into a ModelRetry, while a KeyError produces a response indicating an unknown reference.

The agent in this example uses Ollama locally, instructed to return the catalog price in cents. Business permissions and dependency maintenance remain the responsibility of the team. Dependency on the framework may ultimately cost more than the connection code it avoids.

REST, Subprocess, or Webhook Depending on Existing Setup

For a service that already has an HTTP interface, one option is to write a REST adapter limited to selected operations, described using OpenAPI. The team remains responsible for identifiers, the authorized scope, and response handling. If the specifications are extensive or change frequently, the adapter may become a component that requires its own maintenance.

A reliable command, with a restricted scope, can be launched in a bounded subprocess. Accepted arguments, granted privileges, and process failures must be managed explicitly. Unreliable code or broader access requires true isolation.

When a workflow platform is already in use, an authenticated webhook can serve as a call point. The team retains responsibility for the workflow, identifiers, and what constitutes its completion. Setting up such a platform solely for this connection may require more work than the integration saves.

La lettre du soirGratuit · 19 h

Le brief IA que les pros lisent chaque soir

Les 7 actus IA du jour, décryptées en 5 min. Gratuit.

Inclus dès l'inscription : notre sélection des meilleurs guides & comparatifs IA.

Choisissez votre rythme

Gratuit · Pas de spam · Désabonnement en 1 clic

The exposed function may itself mask complex processing, such as extracting tables from PDFs via an SDK, with the agent only receiving the produced fields. The commercial SDK Apryse cited for this use is subject to its own licensing terms.

Ollama Leaves the Loop to the Application

When functions and model calls reside in the same Python process, a native interface can rely on a simple dictionary associating allowed names with executable functions. This dispatcher must remain fixed: neither getattr nor a mechanism allowing the model to freely designate an object should replace it. The demonstration catalog requires only the standard library.

With Ollama, the schema accompanies the conversation request; the model then returns a message containing tool_calls rather than a textual response. The application performs the operation, inserts its result into a tool message, and then queries the model again. It retains management of permissions, exchanges, the maximum number of turns, and errors.

In a second run of the demonstration, a non-existent reference results in a structured error response, rather than an exception. The model then informs the user without generating a price.

The trade-off of this direct connection is its lack of portability: message formats, particularly tool_calls, vary between providers. Multiple clients or providers may necessitate a reusable contract.

MCP and Common Tool Controls

MCP serves to make tools discoverable and callable by multiple compatible hosts: the server provides the description to clients. In the architecture revised on July 28, 2026, stdio allows operation on the same machine, while Streamable HTTP covers HTTP exchanges. Adopting MCP does not require creating a network service.

Regardless of the connection, the sequence remains the same: the model suggests a tool and arguments, then the application checks the name, parameter compliance, and user rights. The executor then intervenes; the application transmits to the model either the structured data obtained or an explicit error. Changing the executor or execution location does not alter the business rule or these obligations. OWASP distinguishes in this regard the excesses of functionality, permissions, and autonomy, which pertain to the application rather than transport.

The demonstrations rely on lookup_product(sku), a function that reads a catalog to return a price, with qwen3.5:4b under Ollama 0.40.13; the outputs are presented as those printed by the code. The references follow the pattern ^[A-Z]{2}-\d{2,4}$. The catalog is fictional, and each entry contains fixture: true: BK-17 corresponds to an A5 notebook priced at 1,299 cents in USD, while BK-18 corresponds to an A4 notebook priced at 1,799 cents in USD.

Brief IA — L'actualité IA en français

L'essentiel de l'actualité de l'intelligence artificielle, décrypté et expliqué chaque jour.