Model Context Protocol vs Direct Function Calling: Trade-Offs for ADK Agents
A rigorous comparison of MCP and native function calling — latency, discovery, governance, security surface, portability, and testing — plus a decision table for when to use each, and how ADK lets you combine both.
Published on • November 27, 2026
AI Assistant

Two ways to give a model hands: write Python functions and let the framework describe them to the model, or attach a standardised tool server that any client can speak to. The first is direct function calling; the second is the Model Context Protocol. Both work, and the choice is rarely about capability — it’s about who owns the tools, how often they change, and how much latency and governance you can afford.
This comparison walks the dimensions that actually decide it, then shows how ADK lets you use both in one agent.
Direct function calling, in one paragraph
You define a function; the framework inspects its name, docstring, parameters, type hints, and defaults, generates a JSON schema, and ships that schema with the request. The model returns a FunctionCall, the framework executes your function, and the result goes back as a FunctionResponse. In ADK a plain function in tools=[...] becomes a FunctionTool automatically.
Strengths: zero extra round trips, types and validation you already own, unit-testable locally, full control of errors and permissions, and secrets that never enter the model’s context.
Cost: the tool is code in your repo. Sharing it with another team or another vendor’s agent means copying and re-documenting it.
MCP, in one paragraph
A standard client/server protocol for tools, resources, and prompts: a server exposes typed capabilities, a client discovers and invokes them over a transport (stdio for local processes, SSE or streamable HTTP for remote). The agent doesn’t need to know what the server implements — it reads the server’s advertised tool list at connection time.
Strengths: write once, usable by every MCP-aware agent; discovery means new tools appear without a code release; an independent lifecycle for tool ownership; cross-vendor portability.
Cost: an extra process or connection, schema discovery at startup, another protocol surface to secure, and a versioning story you have to manage.
The trade-offs, dimension by dimension
| Dimension | Direct function calling | MCP |
|---|---|---|
| Latency | One in-process call; no discovery | Connection setup + tools/list + remote call per invocation |
| Tool discovery | Compile time (schema built from your code) | Runtime (query the server) |
| Ownership | Same repo, same review, same deploy | Separate service/team, independent releases |
| Type safety | Native Python types, Pydantic, dataclasses | JSON-schema over the wire; conversion layer |
| Security surface | Your process and its libraries | New process/network boundary, remote code paths, tool descriptions from a third party |
| Secrets | Fetched inside your function | Server holds them — can be better or an unknown |
| Versioning | You break it, you fix it | Server can change under you; negotiate versions |
| Portability | Locked to your framework/language | Any MCP client can consume it |
| Testing | Unit-test the function directly | Needs a test server or a mock transport |
| Failure modes | Exceptions you already handle | Timeouts, transport drops, malformed tool schemas |
Latency, concretely
Direct: nanoseconds-to-milliseconds, in-process.
MCP over stdio: a local process spawn at startup (amortised) plus an IPC round trip per call — usually small, but it exists.
MCP over HTTP: every call can add a network hop, and the initial tools/list costs a full round trip after connection. In an interactive agent with a tight TTFT budget, budget for it explicitly: connection warm-up belongs in your TTFT measurements, not in the “model is slow” bucket.
Security, concretely
Direct function calling gives you one trust boundary: your code. MCP adds several:
- Tool descriptions are untrusted input. A malicious or compromised server can describe a tool whose name or description tries to manipulate the model (an indirect prompt-injection vector). Treat
tools/listoutput like any other third-party content. - Remote servers need auth — and per-tool scoping matters: an agent that only needs
searchshouldn’t inherit a server’sdelete. - Transport choice is a threat model. stdio implies local trust; streamable HTTP implies TLS, authentication, and network egress policy.
Direct calling has its own version of this — tool arguments come from the model, so sanitise them — but the boundary is inside code you can review.
Governance and versioning
With direct tools, the tool’s contract evolves with your codebase: rename a parameter and the schema updates in the same commit.
With MCP, consumers pin against a server whose tool set can change on its own schedule. That’s the whole value proposition (independent ownership) and the whole hazard. Mitigate with explicit version pinning, a schema snapshot in CI, and a contract test that fails when the server’s advertised tools drift from what you expect.
Decision table
| You should use direct function calling when | You should use MCP when |
|---|---|
| The tool is intrinsic to this agent’s job | The tool serves many agents/teams/products |
| Latency budget is tight | You can afford connection warm-up |
| It touches secrets or internal state you must gate | A separate team owns the tool and its auth |
| You need deep unit tests and typed returns | Tools must be discovered at runtime |
| You’re on one framework, forever | Portability across vendors is a real requirement |
| The tool’s contract changes with your releases | The tool’s contract changes independently |
Neither answer is exclusive: most production agents end up with both — a handful of core, latency-critical, secret-bearing functions defined directly, plus MCP servers for the long tail of integrations (issue trackers, browsers, office systems).
Using both in ADK
ADK’s tooling accepts plain functions and MCP toolsets side by side:
from google.adk import Agent
from google.adk.tools import MCPToolset, RemoteMcpServer
agent = Agent(
name='support_agent',
model='gemini-3.8-flash',
instruction=SYSTEM_INSTRUCTION,
tools=[
# direct: latency-critical, touches internal state
lookup_customer,
# MCP: an independently owned integration
MCPToolset(
connection_params=RemoteMcpServer(
url='https://mcp.acme-tools.dev/support',
headers={'Authorization': 'Bearer ...'},
),
tool_filter=['search_tickets', 'update_ticket_status'],
),
],
)
Two details do a lot of work there:
tool_filter. Import only the tools you intend to use. Every advertised tool costs prompt tokens on every request — a server exposing forty tools you don’t call is a permanent tax on your context budget.- Connection lifecycle. Local stdio servers start with the agent; remote servers need connection warm-up, timeouts, and a story for what happens when they drop mid-turn (fall back to answering “I can’t reach that system right now” rather than hanging).
For testing, keep the seam mockable: unit-test direct functions normally, and mock the MCP transport (or run a local stub server) in integration tests so a contract drift fails CI instead of production.
Takeaways
- Direct function calling optimises for latency, type safety, and review; MCP optimises for ownership, discovery, and cross-vendor portability.
- Count MCP’s real costs: startup discovery, per-call round trips, a new auth surface, and independent versioning.
- Treat MCP tool descriptions as untrusted content and scope permissions per tool, not per server.
- Use a decision table, not a default: core/latency/secret-bearing functions stay direct; the integration long tail goes behind MCP.
- In ADK, both coexist — filter imported tools, warm connections, and mock the transport in tests.