From ed4c36bfbfe4e419c692cd0d17d7e58bd8435104 Mon Sep 17 00:00:00 2001 From: Hirofumi Horikawa Date: Sun, 21 Sep 2025 08:36:02 +0900 Subject: [PATCH 1/3] Fix JSON structure in model context protocol REST API samples --- .../tools/model-context-protocol-samples.md | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md b/articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md index b4fbb976977..14ac470e635 100644 --- a/articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md +++ b/articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md @@ -345,19 +345,19 @@ curl --request POST \ --url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=$API_VERSION \ -H "Authorization: Bearer $AGENT_TOKEN" \ -H "Content-Type: application/json" \ - -d "{ + -d '{ "instructions": "You are a customer support chatbot. Use the tools provided and your knowledge base to best respond to customer queries.", "tools": [ - { - "type": "mcp", - "server_label": "", - "server_url": "", - "allowed_tools": [""], # optional - } - ], - "name": "my-assistant", - "model": "gpt-4o", -}" + { + "type": "mcp", + "server_label": "", + "server_url": "", + "allowed_tools": [""] # optional + } + ], + "name": "my-assistant", + "model": "gpt-4o" + }' ``` ## Create a thread @@ -402,17 +402,16 @@ curl --request POST \ -d '{ "assistant_id": "", "tool_resources": { - "mcp": [ - { - "server_label": "", - "require_approval": "always" #always by default - "headers": { - "Authorization": "Bearer ", - } - + "mcp": [ + { + "server_label": "", + "require_approval": "always" #always by default + "headers": { + "Authorization": "Bearer " } - ] - }, + } + ] + } }' ``` @@ -472,15 +471,15 @@ curl --request POST \ -H "Authorization: Bearer $AGENT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ - "tool_approvals": [ - { - "tool_call_id": "call_abc123", - "approve": true, - "headers": { - } + "tool_approvals": [ + { + "tool_call_id": "call_abc123", + "approve": true, + "headers": { } + } ] -} + }' ``` ## Retrieve the agent response From 4f8104c51d1ac00453c958a0257b4f9f227da84a Mon Sep 17 00:00:00 2001 From: Hirofumi Horikawa Date: Sun, 21 Sep 2025 17:14:38 +0900 Subject: [PATCH 2/3] Fix formatting of require_approval in documentation --- .../agents/how-to/tools/model-context-protocol-samples.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md b/articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md index 14ac470e635..ebb7be2ffb5 100644 --- a/articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md +++ b/articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md @@ -405,7 +405,7 @@ curl --request POST \ "mcp": [ { "server_label": "", - "require_approval": "always" #always by default + "require_approval": "always", #always by default "headers": { "Authorization": "Bearer " } From e9cd5050bbaf584634a895bc640fe6c908a9dcf7 Mon Sep 17 00:00:00 2001 From: Hirofumi Horikawa Date: Mon, 22 Sep 2025 16:21:51 +0900 Subject: [PATCH 3/3] Update MCP Tool documentation with python package requirements --- .../agents/how-to/tools/model-context-protocol-samples.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md b/articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md index ebb7be2ffb5..71e82d9e23f 100644 --- a/articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md +++ b/articles/ai-foundry/agents/how-to/tools/model-context-protocol-samples.md @@ -157,6 +157,8 @@ agentClient.Administration.DeleteAgent(agentId: agent.Id); The following code sample begins by setting up the necessary imports, getting the relevant MCP server configuration, and initializing the AI Project client. It then creates an agent, adds a message to a thread, and runs the agent. +> [!NOTE] +> To run the following code, `azure.ai.projects==1.1.0b4` and `azure.ai.agents==1.2.0b4` are required. ```python # Import necessary libraries