Skill 180 · Foundry Agentic Loop
Subchapter 180.10
references/foundry-toolbox.mdMarkdown5 KBView on GitHub
Reference for the foundry-agentic-loop skill: how a solution’s skills, MCP tools and grounding reach its hosted agents through one Foundry toolbox. microsoft-foundry owns the command surface and tool types (its toolbox guide), azd-layout.md owns the declarative services, and copilot-sdk-with-toolbox.py is the reference consumer.
SKILL.md (front matter with name and description, then Markdown instructions) versioned in the project. Skills are in preview.<project>/toolboxes/<name>/mcp?api-version=v1 always serves the default version, so promoting a toolbox version reaches agents without a redeploy. The developer URL .../toolboxes/<name>/versions/<v>/mcp?api-version=v1 pins one version.skill://<name>/SKILL.md) that follow the skill’s default version unless the toolbox pins version. The agent writes them under the temp directory per request, because hosted containers are read-only except /tmp; the agent image never copies skills/.skills/<name>/SKILL.md; its front matter name matches the folder.python-mcp-server-generator from build-skills-catalog.md). Reach servers through connections, never hard-coded URLs or secrets. Expose Foundry IQ grounding through the toolbox too (foundry-iq-grounding.md).skills[], connections[] (connections must already exist), and connectionless built-ins such as web_search or code_interpreter under tools[]. At most one tool may be unnamed: name built-ins with name and MCP tools with server_label. Before exceeding about five tools, add toolbox_search_preview, which counts as the unnamed tool.SDD: declare azure.ai.skill, azure.ai.connection and azure.ai.toolbox services (azd-layout.md). Deploy publishes them in uses order and writes TOOLBOX_<NAME>_MCP_ENDPOINT; map it to the agent’s TOOLBOX_ENDPOINT. Without approval to upgrade older extensions, use the ordered postprovision fallback in the same file.
Rapid: publish with the CLI against the selected project (azd ai project set <project-endpoint>):
azd ai skill create claims-policy --file skills/claims-policy/SKILL.md --no-prompt # later versions: azd ai skill update
azd ai toolbox create claims-tools --from-file toolbox.yaml --no-prompt # writes TOOLBOX_CLAIMS_TOOLS_MCP_ENDPOINT# toolbox.yaml
description: Claims tools
skills:
- name: claims-policy # omit version to follow the skill's default
connections:
- name: claims-mcp-conn # RemoteTool (MCP)
- name: policy-search # CognitiveSearch needs index
index: policies
tools:
- type: web_search
name: webChange: azd ai toolbox connection add|remove and azd ai toolbox skill add|remove each create a version without changing the default; promote or roll back with azd ai toolbox publish <name> <version>. Connectionless built-ins can’t be added later: recreate the toolbox with the full set. azd ai skill update <name> --set-default-version <v> rolls a skill without uploading content.
Extensions: azure.ai.toolboxes, azure.ai.skills and azure.ai.connections, at the minimum versions in azd-layout.md.
Follow copilot-sdk-foundry.md and the reference agent:
TOOLBOX_ENDPOINT, never a FOUNDRY_* name, which the platform overwrites. If the written URL pins /versions/<v>/, redeploy the agents that use the toolbox after it changes; record which form each agent uses.https://ai.azure.com/.default on every request (cognitiveservices tokens get 401), Foundry-Features: Toolboxes=V1Preview, and the caller’s x-agent-foundry-call-id when present.initialize is optional; prompts/list and ping are unsupported. MCP-sourced tools are named <server_label>___<tool>.require_approval: approve tools in the agent’s permission handler.-32006 error wrapping CONSENT_REQUIRED carries a per-user consent URL for an OAuth connection: surface it to the caller instead of retrying.-32007 error wrapping 403 comes from the MCP server’s own auth.tools/list returns the expected tools and resources/list the expected skill:// entries.README.md (rapid) or docs/implementation.md (SDD).Sources: microsoft-foundry toolbox and skills guides; Toolbox (opens in a new tab); Skills (opens in a new tab).