Skip to main content

Toolboxes in Microsoft Foundry

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

  1. 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.
  2. 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.
  3. 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.
  4. Consume from agents
    - Point agent runtimes to the toolbox MCP endpoint.
    - Invoke tools by namespace and name; rely on Foundry for auth and routing.
  5. 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

Popular posts from this blog

Conditionally Hiding Menu Items in D365 FinOps Menus Without Using Feature Keys

In Microsoft Dynamics 365 Finance and Operations (D365 F&O), menu items are the links that can be clicked on to access forms, reports, classes, jobs, and queries. Feature keys are typically used to control the visibility of menu items based on user licenses. However, there are scenarios where you might want to hide menu items conditionally without relying on feature keys.  This can be accomplished by extending the 'SysMenuNavigationObjectFactory' class and modifying the checkAddSubMenu(...) method.  Suppose we want to hide the  Vendor payment journal menu item under Accounts payable > Payments > Vendor payment journal Steps 1. Create an extension of the SysMenuNavigationObjectFactory class [ ExtensionOf ( classStr (SysMenuNavigationObjectFactory))] internal final class SysMenuNavigationObjectFactory_PS_Extension { } 2. Create a Chain of Command (CoC) for the checkAddSubMenu method [ ExtensionOf ( classStr (SysMenuNavigationObjectFactory))] internal final...

User Security Governance (Preview) feature in D365 FO

Let's take a first look at User security governance . It is the latest set of features in the D365F&O 10.0.43 update which provides useful tools to System administrators for role management, licenses auditing, enhanced audit trails and versioning, supported with some useful very useful reports around license usage, separation of duties violations etc. Key aspects of this feature include: Role Management: Improved tools for creating, modifying, and managing user roles. Audit Trails: Enhanced tracking of changes made to security settings, helping administrators monitor and review security configurations. Compliance: Tools to ensure that security settings comply with organizational policies and regulatory requirements. Feature management A new feature called (Preview) User security governance has been added to Feature management to control the overall functionality. Navigate to System administration > Security > Security governance to explore all the features. Security analy...

Process automation in Microsoft dynamics 365 Finance and Operations

Process automation in Microsoft Dynamics 365 Finance and Operations (D365FO) is a powerful feature that allows you to schedule processes to be executed by the batch server automatically. It simplifies the creation of batch jobs, thanks to the built-in wizards within the Process Automation setup. The updated calendar view of the scheduled work allows end users to view and take action on scheduled and completed work.  The central administration page for all process automations is found in the System Administration module under the Setup menu. This page will list all automated processes (series) that are set up in the system. It will also allow you to add new process automations directly from this page. After a series is set up, you can manage each series from this list. You can choose to edit the entire series, delete it, view all occurrences in a list view, or disable the series if you would like to pause the scheduled work for a while. For more information about process automa...