AI agents become useful when they can do more than generate text. A production agent often needs to retrieve information, call business APIs, access databases, work with documents, or invoke specialized tools.
This creates an architecture problem: how should an AI model connect to those capabilities without tightly coupling every tool to the model itself?
Microsoft Foundry provides an environment for building and working with AI applications, while Model Context Protocol (MCP) provides a standardized way for AI applications to discover and interact with tools and resources.
Claude models available through Microsoft Foundry can therefore be used as part of an agent architecture where the model reasons about a task and tools provide the capabilities needed to complete it.
This article explains the architecture behind Claude-based agents, how MCP fits into the design, and how a .NET application can structure tool access safely.
Why Tools Matter for AI Agents
A language model is good at reasoning over information available in its context, but many real applications require actions outside that context.
Consider an internal support agent:
User
|
v
AI Agent
|
+----> Search Knowledge Base
|
+----> Check Order Status
|
+----> Create Support Ticket
|
+----> Retrieve Account Information
Without tools, the model can explain how to perform these operations, but it cannot necessarily perform them.
Tools provide an execution layer.
A tool might expose a simple operation such as:
public sealed record OrderStatus(
string OrderId,
string Status);
The agent can decide that it needs order information, invoke the appropriate tool, receive the result, and continue its reasoning.
The important architectural distinction is:
Model = reasoning
Tool = capability
Application = policy and execution
The model should not become the security boundary for the tool.
What Is Microsoft Foundry in This Architecture?
Microsoft Foundry can be used as a platform for developing AI applications and working with models and agent-oriented workloads.
In an application architecture, it can sit behind your application or orchestration layer:
+---------------------+
| User |
+----------+----------+
|
v
+---------------------+
| Application |
| Orchestrator |
+----------+----------+
|
v
+---------------------+
| Model / Agent |
| Claude |
+----------+----------+
|
v
+---------------------+
| Tool Layer |
+---------------------+
The application remains responsible for authorization, business rules, data access, and operational controls.
This separation is important for production systems.
What Is MCP?
Model Context Protocol, commonly called MCP, defines a standardized approach for connecting AI applications with external tools and resources.
Instead of creating a completely different integration mechanism for every model and tool combination, an MCP-based architecture can expose capabilities through a consistent protocol.
Conceptually:
+-------------+
| AI Agent |
+------+------+
|
| MCP
|
+------+------+
| MCP Server |
+------+------+
|
+----> Database
|
+----> API
|
+----> Internal Service
The MCP server becomes an integration boundary.
For example, an internal order-management MCP server might expose:
get_order_status
search_orders
get_customer
The AI application can discover the available tools and use them when appropriate.
Claude + MCP + Foundry
A useful architecture combines these pieces:
+----------------+
| User |
+-------+--------+
|
v
+----------------+
| Application |
| Orchestrator |
+-------+--------+
|
v
+----------------+
| Claude Model |
| in Foundry |
+-------+--------+
|
| Tool request
v
+----------------+
| MCP Client |
+-------+--------+
|
v
+----------------+
| MCP Server |
+-------+--------+
|
+--------------+--------------+
| | |
v v v
Orders Search Internal API
The model decides when a tool is useful, while the application and MCP infrastructure control how that tool is invoked.
Designing an MCP Tool
A tool should represent a meaningful business operation.
For example:
get_order_status
is generally easier for an agent to understand than a generic operation such as:
execute_database_query
A well-designed tool should have:
A clear name
A concise description
Explicit input parameters
A predictable response
Well-defined failure behavior
Appropriate authorization
For example, a request might conceptually look like:
{
"orderId": "ORD-10025"
}
The tool should validate the identifier before accessing the underlying system.
Keep Business Logic Outside the Model
Suppose an agent asks for an order status.
Do not rely on the model to determine whether the current user is authorized to see that order.
The architecture should instead be:
User
|
v
Application Authorization
|
v
Agent
|
v
MCP Tool
|
v
Business Service
|
v
Database
Authorization should be enforced by the application or service layer.
This prevents a model from becoming the authority over sensitive business data.
A Simple .NET Tool Layer
A .NET application can keep tool execution behind an interface.
public interface IOrderService
{
Task<OrderStatus?> GetStatusAsync(
string orderId,
CancellationToken cancellationToken);
}
Join the conversation! Your thoughts help the community grow.