-
I noticed tool_resources can be passed to multiple APIs, however is not remembered when used in agent and thread level, I'm not sue if this is only the case for MCP. curl --request POST --url "https://me.services.ai.azure.com/api/projects/my-project/assistants?api-version=2025-05-15-preview" \
-H "Authorization: Bearer $MY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"name": "my-mcp-agent",
"instructions": "You are a helpful agent that can use MCP tools to assist users. Use the available MCP tools to answer questions and perform tasks.",
"tools": [
{
"type": "mcp",
"server_label": "deepwiki",
"server_url": "https://mcp.deepwiki.com/mcp"
}
],
"tool_resources": {
"mcp": [
{
"server_label": "deepwiki",
"headers": {},
"require_approval": "never"
}
]
}
}' Response, check the tool_resources property: {
"id": "asst_123",
"object": "assistant",
"created_at": 1753919431,
"name": "my-mcp-agent",
"description": null,
"model": "gpt-4o-mini",
"instructions": "You are a helpful agent that can use MCP tools to assist users. Use the available MCP tools to answer questions and perform tasks.",
"tools": [
{
"type": "mcp",
"server_label": "deepwiki",
"server_url": "https://mcp.deepwiki.com/mcp",
"allowed_tools": null
}
],
"top_p": 1.0,
"temperature": 1.0,
"tool_resources": {},
"metadata": {},
"response_format": "auto"
} Again, this also happens with threads. Looks like tool_resources is only honored in run level. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
HI @jozkee - could you share more details on the services/technologies you are using so the community can provide better guidance? Looks like possibly Azure AI Agent Service (project in Foundry) via REST API calling an MCP server you have created and hosted? Also worth taking a look at this question from the forum a while back about Agent, Run and Thread level access to tools using the Azure AI Agent Service https://github.com/orgs/azure-ai-foundry/discussions/98 |
Beta Was this translation helpful? Give feedback.
Our agents team have also recommended taking a look at this C# sample: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample26_PersistentAgents_MCP.md
and one for streaming scenarios: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample27_PersistentAgents_MCP_Streaming.md
This uses an MCP tool definition in Azure.AI.Agents.Persistent