Integrating Built-in, MCP and Custom Tools with Agents
This lesson surveys the tools available in Foundry Agent Service, which connect agents to APIs, knowledge stores, search, content understanding and custom logic, and how to integrate them securely.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the built-in and connected tools and their configuration.
- Configure an MCP tool for an agent.
- Use Content Understanding and custom functions as tools.
- Apply tool security practices, such as treating tool output as untrusted.
Built-in and connected tools
A tool is a capability that an agent can call during a run to obtain information or take an action that the model cannot perform by itself. The agent's model reads each tool's name and description, decides when a tool is needed and supplies its arguments. Built-in tools are provided and run by Foundry Agent Service, and connected tools reach external APIs and systems through a connection. Foundry Agent Service offers tools in three broad groups, and each group differs in who runs the tool and how it authenticates.
Knowledge tools give the agent content to ground its answers: file search over uploaded files, the Azure AI Search tool over an existing index, Foundry IQ knowledge bases for agentic retrieval across several sources, and Grounding with Bing Search for current public web information.
Action tools let the agent do things: the OpenAPI tool calls any REST API described by an OpenAPI 3 specification, the MCP tool calls tools published by a Model Context Protocol server, and Azure Functions and Logic Apps connect to serverless code and business systems.
Execution tools run work inside the service: code interpreter executes Python in a sandbox for calculations, charts and file processing, and further tools automate a browser or generate images.
Function tools, covered in the previous lesson, sit outside these groups because the application, not the service, runs them. The tools also differ in authentication: knowledge tools use project connections, action tools use anonymous access, a key stored in a connection or a managed identity, and some Microsoft 365 sources pass the user's own identity through. The following table lists the main tools.
| Tool | Use | Authentication or configuration |
|---|---|---|
| File search | Search uploaded files | Vector store IDs |
| Azure AI Search | Search an existing index | Project connection, index name, query type |
| Foundry IQ knowledge base | Agentic retrieval over several sources | Knowledge base MCP endpoint |
| Grounding with Bing Search | Current public web information with citations | Bing connection; separate terms |
| Code interpreter | Run Python for calculations, charts and file processing | Sandboxed sessions |
| OpenAPI | Call REST APIs described by an OpenAPI 3 specification | Anonymous, connection key or managed identity |
| MCP | Tools from a remote MCP server | Server URL, allowed tools, approval, headers or connection |
| Azure Functions, Logic Apps | Serverless code and business-system connectors | Function or workflow endpoint |
| SharePoint, Microsoft Fabric | Microsoft 365 and analytics data | User identity passthrough where supported |
| Browser automation, image generation | Web tasks; creating images | Additional deployments or resources |
When a tool is added to an agent, the Custom tab of the Select a tool dialog offers the three ways to connect the organization's own APIs and agents, as the following screenshot shows: an OpenAPI tool, a Model Context Protocol (MCP) server and another agent through Agent2Agent (A2A).

Agent tools
MCP tools
The Model Context Protocol (MCP) is an open protocol in which a server exposes tools with schemas that any compatible client can discover and call. An MCP tool in an agent specifies a server label and URL, an optional list of allowed tools, whether calls require approval, and authentication headers or a project connection. When approval is required, the response contains an mcp_approval_request item; the application asks the user or an operator and replies with an mcp_approval_response.
from azure.ai.projects.models import MCPTool
crm = MCPTool(
server_label="crm",
server_url="https://mcp.contoso.com/crm",
allowed_tools=["find_customer", "get_open_cases", "create_case"],
require_approval={"always": {"tool_names": ["create_case"]}}, # read-only tools run without approval
project_connection_id=crm_connection_id, # stores the auth header securely
)Content understanding and custom functions as tools
When users upload documents, images or recordings, an agent can call a function or OpenAPI tool that sends the file to an Azure Content Understanding analyzer and returns Markdown and typed fields, so the agent reasons over clean, structured content rather than raw files. Custom functions wrap any business logic, such as eligibility checks or price calculations, with a schema. Custom functions are the place to enforce business rules, validate arguments and apply the caller's permissions.
Tool security
Every tool widens what an agent can do, and tool outputs are untrusted input. Tools should use managed identities or the user's delegated identity with least privilege, tool responses should be scanned for indirect attacks at the tool response intervention point, and high-impact tools should require approval. Grounding with Bing Search sends queries outside the Azure compliance boundary, so organizations confirm that this is acceptable before enabling it.
Each connected tool also has an authentication method. The following screenshot shows the options for an MCP tool: a key sent in a header, OAuth identity passthrough of the signed-in user, Microsoft Entra ID, or no authentication for a public server such as Microsoft Learn.

Secure the tools
Integrating an internal API
An agent must call an internal inventory REST API that already has an OpenAPI 3 specification and accepts Microsoft Entra ID tokens. The team wants no custom tool code and no stored secrets.
Add an OpenAPI tool with the specification and managed identity authentication, and grant the agent project's managed identity access to the API. A function tool would require the application to host and run the call; an MCP server would require building a server.
What compliance consideration applies to Grounding with Bing Search?
Show answer
Queries are sent outside the Azure compliance boundary, which may not be acceptable for sensitive data.
Exam Tips
Remember for the exam
- Existing REST API with an OpenAPI spec: OpenAPI tool with managed identity authentication.
- MCP: restrict allowed tools and require approval for tools that change data.
- Grounding with Bing Search sends queries outside the Azure compliance boundary.