Microsoft has just introduced Toolboxes in MS Foundry - a managed, versioned bundle of curated tools that any MCP‑compatible agent can consume through a single endpoint, removing per‑agent wiring, centralizing auth, and enabling safer rollouts
What is a Toolbox in MS Foundry
Toolboxes in MS Foundry lets you define a reusable set of tools once (APIs, MCP servers, connectors, skills, flows), configure authentication centrally, and expose them through a single MCP‑compatible endpoint that agents discover and call at runtime. This removes duplicated integration code and secret sprawl across agents. Read more on toolboxes here.
How do Toolboxes Work?
Toolboxes are a named, versioned collection of tools you manage inside Microsoft Foundry and expose through a single MCP‑compatible endpoint. Each toolbox groups tools by namespace; tools can be APIs, MCP servers, connectors, skills, or flows. At runtime an agent points to the toolbox endpoint, discovers available tools, and invokes them. Foundry handles credential injection, token refresh, and routing so agents don’t need per‑agent wiring or secret management.
Creating a Toolbox in MS Foundry
Design the toolbox
- Select tools that multiple agents will need (APIs, connectors, skills).
- Define namespaces and naming conventions to avoid collisions and make discovery predictable.
Configure authentication
- Store credentials centrally in Foundry and map them to tools.
- Define token lifecycles and refresh behavior so agents never hold long‑lived secrets.
Publish a version
- Create a sandbox version and run integration tests with a consuming agent.
- Validate observability: logs, traces, and metrics must show which agent invoked which tool.
Consume from agents
- Point agent runtimes to the toolbox MCP endpoint.
- Invoke tools by namespace and name; rely on Foundry for auth and routing.
Promote and operate
- Promote a tested version to default when ready.
- Monitor usage and costs; map toolbox calls to cost centers and owners.
Creating a Toolbox from a DotNet project
using Azure.Identity;
using Azure.AI.Projects;
// Create Foundry project client
var projectEndpoint =
"https://<your-foundry-account>.services.ai.azure.com/api/projects/<your-project>";
AIProjectClient projectClient =
new(new Uri(projectEndpoint), new DefaultAzureCredential());
AgentToolboxes toolboxClient =
projectClient.AgentAdministrationClient.GetAgentToolboxes();
ProjectsAgentTool webTool = ProjectsAgentTool.AsProjectTool(
ResponseTool.CreateWebSearchTool());
ProjectsAgentTool mcpTool =
ProjectsAgentTool.AsProjectTool(ResponseTool.CreateMcpTool(
serverLabel: "myserver",
serverUri: new Uri("https://your-mcp-server.example.com"),
toolCallApprovalPolicy: new McpToolCallApprovalPolicy(
GlobalMcpToolCallApprovalPolicy.NeverRequireApproval
)
));
ToolboxVersion toolboxVersion =
await toolboxClient.CreateToolboxVersionAsync(
toolboxName: "my-toolbox",
tools: [webTool, mcpTool],
description: "Toolbox with web search and an MCP server"
);
Console.WriteLine($"Created toolbox: {toolboxVersion.Name}, version: {toolboxVersion.Version}");
Note:
You can select one of the two endpoint options below based on your role:
- Toolbox developer - {project_endpoint}/toolboxes/{toolbox_name}/versions/{version}/mcp?api-version=v1
- Toolbox consumer - {project_endpoint}/toolboxes/{toolbox_name}/mcp?api-version=v1
The first version of a new toolbox is automatically promoted to default_version (v1). If you need to change the default later, see
Endpoint patterns.
You can confirm that the toolbox loads the expected tools by using an MCP client SDK against the endpoint. You can Use the REST API tab to verify tool availability from .NET, or use the Python MCP client SDK. Read more
here
Integrate and use a toolbox in an agent from a DotNet project
The following code snippet:
- Creates the Azure OpenAI and Toolbox MCP clients using DefaultAzureCredential, pointing to the model deployment and the toolbox MCP endpoint.
- The Toolbox client automatically discovers available tools (tools/list) and invokes them (tools/call).
- Starts a ResponsesServer and injects both clients into an AgentConfig so the agent can use the model and toolbox tools at runtime.
using Azure.AI.AgentServer.Responses;
using Azure.AI.AgentServer.Responses.Models;
using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Extensions.DependencyInjection;
using OpenAI.Chat;
// Azure OpenAI endpoint and model deployment
var openAiEndpoint = "https://<account>.services.ai.azure.com";
var deployment = "gpt-4o"; // supports all toolbox tool types
// Toolbox MCP endpoint (platform-injected at runtime via TOOLBOX_MCP_ENDPOINT)
var toolboxEndpoint =
"https://<account>.services.ai.azure.com/api/projects/<project>/toolboxes/<toolbox-name>/versions/<version>/mcp?api-version=v1";
// Azure OpenAI client
var credential = new DefaultAzureCredential();
var openAIClient = new AzureOpenAIClient(new Uri(openAiEndpoint), credential);
var chatClient = openAIClient.GetChatClient(deployment);
// Toolbox MCP client — discovers tools via tools/list, calls them via tools/call
var toolboxClient = new ToolboxMcpClient(toolboxEndpoint, credential);
ResponsesServer.Run<ToolboxHandler>(configure: builder =>
{
builder.Services.AddSingleton(new AgentConfig(chatClient, toolboxClient));
});
In future iterations, once you have another production-ready version of a toolbox, you can update the toolbox again pointing to the newer version and without the need to change code and agent at all. Read more on
Managing toolbox versions.
Helpful documentation:
Comments
Post a Comment