AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

microsoft-foundry

Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent, managed harness agent, Copilot harness, voice agent, create/update/invoke/evaluate agent, add tool to agent, agent insights, batch/continuous eval, continuous monitoring, agent CI/CD, optimize/improve prompt, optimize agent instructions, Agent Optimizer, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure-prepare).

Original source
microsoft
License
MIT
Pinned revision
3f5b461b2314e01c400564051e92469114c5b68f

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

This skill also requires local files or dependencies. Remote reading alone may not be enough.

Ask your assistant

Use Agentic Memory skills to read microsoft--microsoft-foundry at revision 3f5b461b2314e01c400564051e92469114c5b68f, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 151

foundry-agent/create/references/tools/prompt-agent/tool-mcp.md

MCP Tool (Model Context Protocol)

Connect agents to remote MCP servers to extend capabilities with external tools and data sources. MCP is an open standard for LLM tool integration.

Prerequisites

  • A remote MCP server endpoint (e.g., https://api.githubcopilot.com/mcp)
  • For authenticated servers: a project connection storing credentials
  • RBAC: Contributor or Owner role on the Foundry project

Authenticated Server Connections

For authenticated MCP servers, create an api_key project connection to store credentials. Unauthenticated servers (public endpoints) don't need a connection — omit project_connection_id.

See Project Connections for connection management via Foundry MCP tools.

MCPTool Parameters

| Parameter | Required | Description | |-----------|----------|-------------| | server_label | Yes | Unique label for this MCP server within the agent | | server_url | Yes | Remote MCP server endpoint URL | | require_approval | No | "always" (default), "never", or {"never": ["tool1"]} / {"always": ["tool1"]} | | allowed_tools | No | List of specific tools to enable (default: all) | | project_connection_id | No | Connection ID for authenticated servers |

Approval Workflow

  1. Agent sends request → MCP server returns tool calls
  2. Response contains mcp_approval_request items
  3. Your code reviews tool name + arguments
  4. Submit McpApprovalResponse with approve=True/False
  5. Agent completes work using approved tool results

Best practice: Always use require_approval="always" unless you fully trust the MCP server. Use allowed_tools to restrict which tools the agent can access.

Hosting Local MCP Servers

Agent Service only accepts remote MCP endpoints. To use a local server, deploy it to:

| Platform | Transport | Notes | |----------|-----------|-------| | Azure Container Apps | HTTP POST/GET | Any language, container rebuild needed | | Azure Functions | HTTP streamable | Python/Node/.NET/Java, key-based auth |

Known Limitations

  • 100-second timeout for non-streaming MCP tool calls
  • Identity passthrough not supported in Teams — agents published to Teams use project managed identity
  • Network-secured Foundry can't use private MCP servers in same vNET — only public endpoints

Troubleshooting

| Error | Cause | Fix | |-------|-------|-----| | Invalid tool schema | anyOf/allOf in MCP server definition | Update MCP server schema to use simple types | | Unauthorized / Forbidden | Wrong credentials in connection | Verify connection credentials match server requirements | | Model never calls MCP tool | Misconfigured server_label/url | Check server_label, server_url, allowed_tools values | | Agent stalls after approval | Missing previous_response_id | Include previous_response_id in follow-up request | | Timeout | Server takes >100s | Optimize server-side logic or break into smaller operations |

References