Skip to content

[azure-ai-agentserver-core] Connected MCP tools route returns 404 for hosted LangGraph agent (/agents/{agent}/tools/resolve) #46173

@nathan-sumit

Description

@nathan-sumit

Package Versions

  • azure-ai-agentserver-core: 1.0.0b17
  • azure-ai-agentserver-langgraph: 1.0.0b17
  • azure-ai-projects: 2.0.0b3
  • Python: <3.10/3.11/3.12>
  • OS: Windows

Description

When using azure-ai-agentserver-langgraph with Foundry connected MCP tools ({"type":"mcp","project_connection_id":"..."}), tool resolution/invocation fails because the connected-tools proxy route returns 404.

The SDK appears to call:

  • POST /api/projects/{project}/agents/{agent}/tools/resolve?api-version=2025-11-15-preview
  • POST /api/projects/{project}/agents/{agent}/tools/invoke?api-version=2025-11-15-preview

These return 404 in hosted-agent scenarios.

Repro Steps

  1. Create a hosted LangGraph agent with use_foundry_tools(...).
  2. Include at least one connected MCP tool:
    • {"type":"mcp","project_connection_id":"<connection-name>"}
  3. Invoke the agent through project Responses API.
  4. Observe failure during connected tool resolution or invocation.

Minimal Agent Snippet

from azure.ai.agentserver.langgraph import from_langgraph
from azure.ai.agentserver.langgraph.tools import use_foundry_tools

foundry_tools = [
    {"type": "code_interpreter"},
    {"type": "mcp", "project_connection_id": "<connection-name>"},
]

# middleware=[use_foundry_tools(foundry_tools)]
# invoke agent via project Responses API

Actual Result

  • Connected MCP resolve/invoke path returns 404.
  • Agent run fails when trying to use connected MCP tools.

Example symptom (sanitized):

  • ResourceNotFoundError / HTTP 404 from connected tools route.
  • Route shape: /agents/{agent}/tools/resolve and /agents/{agent}/tools/invoke.

Expected Result

Connected MCP tools should resolve and invoke successfully via SDK without requiring custom monkey patching.

Why this appears to be SDK route/contract issue

  1. In 1.0.0b17, FoundryConnectedToolsOperations uses /agents/{agent}/tools/resolve|invoke with api-version=2025-11-15-preview.
  2. Project connections are valid and retrievable via AIProjectClient.connections.get/list.
  3. Direct MCP JSON-RPC calls to connection targets (tools/list, tools/call) succeed.
  4. Failure is isolated to connected-tools proxy route behavior.

Temporary Workaround

Implemented runtime monkey patch in app code:

  • Catch 404 from connected-tools resolve/invoke.
  • Fallback to direct MCP JSON-RPC (tools/list, tools/call) using connection metadata and auth scope.
  • This works, but should not be required in user code.

Impact

  • Hosted-agent architectures relying on connected MCP tools cannot use default SDK behavior reliably.
  • Forces custom patching and increases operational complexity.

Requested Fix

  • Provide a supported fix in azure-ai-agentserver-core so connected MCP tools work without monkey patches.
  • If route contract changed, document required endpoint/version and update SDK accordingly.
  • Consider built-in fallback or clearer actionable error when route is unavailable.

Metadata

Metadata

Labels

Hosted Agentssdk/agentserver/*Service AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions