Prerequisites
- An active Microsoft Foundry project.
-
RBAC: Grant the Foundry User role on the Foundry project to each identity that applies to your scenario:
- Developer (always required) — the identity that creates, updates, and manages toolbox versions.
- Agent identity (required if using a prompt agent) — the agent’s managed identity that calls tools at runtime.
- End user (required only for OAuth flows) — any user whose identity is proxied through OAuth or UserEntraToken connections (for example, OAuth-based MCP or user Entra token (managed user identity passthrough) flows).
- Your Foundry project needs to be at one of the supported regions. Individual tool types within a toolbox are further limited by region and model – not all tool types are available in every region or with every model. See Region and model compatibility.
- Visual Studio Code (VS Code).
- Install the Microsoft Foundry Toolkit for Visual Studio Code extension from the Visual Studio Code Marketplace.
-
Python SDK:
pip install azure-ai-projects azure-identity -
.NET SDK: Install the coherent preview package set and Azure Identity:
-
JavaScript SDK:
npm install @azure/ai-projects @azure/identity -
Azure Developer CLI: Install the Azure Developer CLI (
azd, 1.25 or later) and the unified Foundry CLI extension bundle:
- A toolbox supports at most one tool without a
namefield (Web Search, Azure AI Search, Code Interpreter, File Search). To include more than one instance of the same tool type, set a uniquenameon each instance to differentiate them. Including two instances of the same type without anamereturns aninvalid_payloaderror. For details, see Multiple tool types. - Add a
descriptionto every tool in your toolbox to help the model select the right tool for each request. - Carefully review each tool’s documentation to learn more about individual tool setup, limitations, and warnings.
- Toolbox reference for guidance on endpoint format, MCP protocol, OAuth consent handling, citation patterns, and troubleshooting.
- Use toolbox in a hosted agent to find guidance on endpoint resolution, env-var contract, payload shape, code integration patterns, and tracing.
- Create: Create a toolbox version with one or more tools. Keep each snippet focused on one task and within 30 lines; use the linked maintained samples for complete applications.
- Publish or select a version: The first version becomes the default automatically. For later versions, test and promote a version when you’re ready to make it the default.
- Attach and consume: Copy the toolbox consumer endpoint, and then integrate it into your agent.
- Verify: Use the version-specific endpoint to list the available tools, and then run one agent request that calls an expected tool.
Feature support
SDKs and tooling support toolbox management operations, as shown in the following table.
You can also manage toolboxes conversationally with Foundry MCP Server. See Manage toolboxes with Foundry MCP Server.
You can add the following tools to a toolbox. This table shows SDK and tooling support for each tool and whether the tool can also be attached directly to an agent (outside a toolbox). For how each tool’s traffic flows when your project uses network isolation, see Network isolation for a toolbox.
Tool availability also depends on your project’s region and model. Before you deploy a toolbox, verify that your target region supports the tool types you plan to use. See Tool support by region and model.
Create a toolbox version
Create a toolbox version based on the tools you need.Get the toolbox MCP endpoint
Two endpoint patterns exist depending on your role:
Replace the placeholders with your own values:
{project_endpoint}is your Foundry project endpoint, in the formhttps://<your-foundry-account>.services.ai.azure.com/api/projects/<your-project>. Copy it from the Overview page of your project in the Foundry portal, or from the Endpoint URL column in the Toolboxes view of the Microsoft Foundry Toolkit for Visual Studio Code.{toolbox_name}and{version}are the toolbox name and version you created in Create a toolbox version.
The first version of a new toolbox is automatically promoted to
default_version (v1). If you need to change the default later, see Promote a version to default.- Select Foundry Toolkit in the Activity Bar.
- Under My Resources, expand Your project name > Tools.
- On the Toolboxes tab, locate your toolbox.
- In the Endpoint URL column, copy the endpoint.
Verify tool availability
Before running the full agent, confirm that the toolbox loads the expected tools by using an MCP client SDK against the endpoint. Use the version-specific endpoint to validate a version before promoting it to default. Check — initialize: HTTP 200. If you skip the initialize step, subsequent calls fail. Check —tools/list:
-
len(tools) > 0— empty means the toolbox version wasn’t provisioned correctly. -
Each tool has
name,description, andinputSchema. For tool naming conventions, see the MCP specification. -
inputSchemahas apropertiesfield (some MCP servers omit this field, which breaks OpenAI). -
Tool names are namespaced by tool type:
-
MCP tools include a
_meta.tool_configurationblock containing runtime settings such asrequire_approval. See Enforce tool approval. -
Note the exact parameter names for the call step (for example
queryvsqueries).
tools/call:
- No top-level
errorfield. If present, inspecterror.code. For standard MCP error codes, see the MCP specification:-32006→ OAuth consent required (extract URL fromerror.message).- Other codes → server-side failure.
result.content[]contains entries with"type": "text"- this is the tool output.- For AI Search, check
result.structuredContent.documents[]for chunk metadata (title,url,id,score). - For File Search, check
result.content[].resource._metafor chunk metadata (title,file_id,document_chunk_id,score). - For Web Search, check
result.content[].resource._meta.annotations[]for URL citations (type,url,title,start_index,end_index). - For Fabric IQ, check
result.structuredContent.documents[]for citation chunks. Each document includestitleandurlfields pointing back to the Fabric item (Ontology, data agent, or Power BI semantic model) used to ground the response. - Watch for
"ServerError"in text content - the tool executed but hit an internal error.
tools/call argument examples:
Integrate the toolbox into your agent
Handle tool approval requirements
The toolbox returns a_meta.tool_configuration object into every tool entry returned by tools/list. When a tool has require_approval set to "always", the agent runtime must present the pending action to the user and wait for confirmation before invoking the tool. The MCP endpoint doesn’t block tools/call. Enforcement is entirely the agent runtime’s responsibility.
After your toolbox is created and tested, connect it to an agent. The integration pattern depends on the agent type:
- Hosted agent (your own code running in Foundry Agent Service): see Use a toolbox with a hosted agent for Agent Framework, LangGraph, Visual Studio Code, and Azure Developer CLI integration patterns and runtime approval requirements.
Configure require_approval on a tool
Set require_approval when you create a toolbox version. The MCP tool examples in Create a toolbox version show both "always" and "never" values. To set it through the SDK:
Manage toolbox versions
You can delete toolbox versions only through the Python SDK, .NET SDK, JavaScript SDK, and REST API. The Azure Developer CLI supports list, get, and publish (default-version promotion) operations.
ToolboxVersionObject. The parent ToolboxObject has a default_version field that controls which version the MCP endpoint serves. Creating a new version doesn’t automatically promote it - you decide when to update default_version. This process lets you stage changes, test a new version independently, and promote it to production on your own schedule.
For the Azure Developer CLI, every mutating operation that targets the current default version —
azd ai toolbox connection add/remove and azd ai toolbox skill add/remove — creates a new toolbox version that carries forward all previously attached connections and skills with the requested change applied. None of these commands automatically change default_version; run azd ai toolbox publish <toolbox-name> <version> when you’re ready to make the new version active. To inspect a pending (non-default) version, use azd ai toolbox show <name> --version <n>.Create a new version
Each create call produces a new version. If the toolbox doesn’t exist yet, the process automatically creates it. When you create the first version of a new toolbox, the default version isv1 until you manually update to another version.
The response is a ToolboxVersionObject containing the new version identifier.
List versions
Get a specific version
Promote a version to default
The MCP endpoint always serves thedefault_version. To switch which version is active, update the toolbox:
Delete a version
Manage toolboxes with Foundry MCP Server
Foundry MCP Server (preview) exposes toolbox management as MCP tools, so you can retrieve, version, update, and delete toolboxes from an MCP client such as GitHub Copilot in Visual Studio Code. To set up the server, see Get started with Foundry MCP Server (preview).
The same versioning rules apply as with the SDKs. Creating a version for an existing toolbox doesn’t change the default version. To promote a version, call
toolbox_update with defaultVersion set to the new version. Before you delete the current default version, set another version as the default.
Example prompts:
- “Show me the
customer-support-toolstoolbox.” - “Get version 2 of
customer-support-tools.” - “Create a new version of
customer-support-tools.” - “Set version 2 of
customer-support-toolsas the default.” - “Set version 1 of
customer-support-toolsas the default, then delete version 2.” - “Delete the
old-support-toolstoolbox.”
Configure tools
Choose the tool type and authentication pattern that match your scenario. Select the tab for your preferred SDK or deployment method. Each tool’s azd tab below shows declarative toolbox YAML. To create a toolbox imperatively without an agent project, use theazd ai toolbox create --from-file workflow and apply the per-tool data shown in the following sections. To deploy a toolbox with a hosted agent, model it as an azure.ai.toolbox service in azure.yaml and wire the agent to it with uses: or toolboxes:.
Multiple tool types
A single toolbox can bundle different tool types. The following example combines Web Search, Azure AI Search, and an MCP server in one toolbox:Each tool type (
web_search, azure_ai_search, code_interpreter, file_search) can appear at most once without a name field. To include multiple instances of the same type, set a unique name on each instance - see the next example.Multi-tool restrictions
You can include at most one instance of each built-in tool type without aname field in a toolbox. If you include two instances of the same type without a name, the API returns:
Two instances of the same tool type
Use thename field to include multiple instances of the same tool type in one toolbox. Each named instance is treated as a separate tool and must have a unique name.
Configure guardrails
Apply a named guardrail policy to a toolbox version to enforce responsible AI content filtering on tool inputs and outputs. The guardrail runs at the toolbox layer, independently of any model-level content filter. Reference a guardrail by its policy name, which you configure in the Foundry portal under Guardrails. Setpolicies.rai_config.rai_policy_name to the name of the policy when creating a toolbox version.
Attach skills to a toolbox
Attach skills to a toolbox version to make them available to agents through the toolbox MCP endpoint. Each skill reference specifies the skill name and an optional version. Omitversion to use the skill’s default_version; pin a version string to use an immutable snapshot.
A toolbox version can contain tools, skills, or both. The following examples create a toolbox version that contains a single skill reference. To add skills to a toolbox that already has tools, include the same tools you used in Create a toolbox version along with the skills array.
Skills attached to a toolbox must exist in the same Foundry project. Cross-project references aren’t supported.
resources/list on the toolbox MCP endpoint and confirm your skill names appear in the response.
Reminder
Thereminder_preview tool enables a hosted agent to schedule itself to run again at a future time. When the agent calls this tool, it specifies a delay in minutes. After that delay, Foundry re-invokes the same agent on the same conversation.
Troubleshoot
The reminder tool is available only for hosted agents. You can’t use the reminder tool with prompt agents.
For full setup instructions, usage examples, and limitations, see Reminder tool for self-scheduling agents.
Region and model compatibility
Toolbox availability depends on two factors beyond the project region:- Region: Some tool types aren’t available in every region that supports the agent service. For example, a region that supports the toolbox endpoint might not support all built-in tool types.
Related content
- Connect agents to Model Context Protocol servers
- Available tools and example prompts for Foundry MCP Server
- Add MCP server authentication
- Web search tool
- Azure AI Search tool
- Guardrails overview
- Manage skills
- Deploy a Hosted agent
- Add a connection to your project
- Configure network isolation for Microsoft Foundry