AI Engineering

RAG vs MCP vs Function Calling: Three Different Architecture Decisions

A model needs to investigate a production problem. It has to find a relevant runbook, query current metrics and explain whether the available observations support a hypothesis.

Should the application use RAG, MCP or function calling?

That question mixes three different architectural decisions. I find it more useful to ask how the application obtains knowledge, how it exposes capabilities and how it lets the model request them.

Three responsibilities, not three competitors

| Mechanism | Responsibility | Example | | --- | --- | --- | | RAG | Retrieve relevant information and include it in model context | Find a runbook describing a database pool problem | | MCP | Standardize how clients discover and invoke tools or access resources | Expose a curated metrics query capability to multiple AI clients | | Function calling | Let a model request a typed operation that the application can execute | Request latency for one authorized service and time window |

These mechanisms can be combined. A function exposed to the model might call an MCP tool that retrieves documents used for RAG. Alternatively, the application may retrieve those documents directly before the model is invoked.

None of these choices transfers authorization to the model.

Start with the evidence you need

In an incident investigation, I would keep the following source classes distinct:

  • Current observations from metrics, logs and traces.
  • Historical incidents, runbooks and other retrieved documents.
  • Deployment and configuration changes.

A runbook can help propose a hypothesis. It is not proof that the current incident has the same cause. A metric observation should retain its timestamp, source and query scope. A retrieved document should retain its identity and provenance.

A small prototype can retrieve documents from an in-memory collection or a conventional search service. Vector indexing is useful for some retrieval problems, but it is not a requirement for RAG. I would introduce it only after measuring retrieval quality and understanding the corpus.

What the application owns

The model may suggest a search query or a tool call. The application should authorize it, validate arguments and cap the result size. Document retrieval must respect the caller's actual access rights before information reaches the prompt.

A retrieved document may also contain instructions. Treat those as untrusted content rather than a new set of system instructions. A document mentioning a privileged operation does not grant permission to invoke that operation.

A decision rule

For one application with a known workflow, direct retrieval and typed application tools may be sufficient. If multiple AI clients need the same curated capabilities, an MCP integration may justify its additional operational surface.

If users need answers grounded in enterprise knowledge, build and evaluate retrieval independently of the tool transport. Measure whether the retrieved sources support the claims, not only whether the response sounds convincing.

The goal is not to use all three mechanisms. The goal is to make each part earn its place in the architecture.

Related reading