Asking a question to a no-code Prompt Agent connected to Foundry IQ fails with 406 Not Acceptable (missing text/event-stream)

Angel Sevillano 0 Reputation points Microsoft Employee
2026-08-14T10:18:50.7666667+00:00

In Microsoft Foundry (Agent Service), when I attach a Foundry IQ Knowledge Base to a no-code Prompt Agent via Knowledge > Add (native Foundry IQ), every question I send to the agent in the playground fails with:

In Microsoft Foundry (Agent Service), when I attach a Foundry IQ Knowledge Base to a no-code Prompt Agent via Knowledge > Add (native Foundry IQ), every question I send to the agent in the playground fails with:

406 Not Acceptable

Client must accept both application/json and text/event-stream

The error happens while the agent tries to enumerate the KB's MCP tools, so the agent never reaches knowledge_base_retrieve and can't answer anything grounded on the knowledge base.

Environment

  • Microsoft Foundry Agent Service, no-code Prompt Agent (portal, ai.azure.com)
  • Foundry IQ Knowledge Base built on Azure AI Search (Standard tier), hybrid + semantic retrieval, system-assigned managed-identity auth, indexing blob documents
  • KB chat model: gpt-5.4-mini; vectorizer: text-embedding-ada-002
  • Foundry project region: Sweden Central; Azure AI Search region: France Central
  • MCP API version: 2026-05-01-preview

What I expected

Asking the Prompt Agent a question should trigger the KB's managed MCP tool (knowledge_base_retrieve) and return a grounded answer with citations, as described in the Foundry IQ docs.

What actually happens

Every prompt fails immediately with the 406 above — the agent can't list its tools, so it never calls the knowledge base. I traced the root cause to a missing Accept header in the internal MCP client used by the native Knowledge attachment.

Isolation / evidence (direct probe of the KB MCP endpoint)

I called the KB MCP endpoint directly (.../knowledgebases/<kb-name>/mcp?api-version=2026-05-01-preview, bearer token for audience https://search.azure.com/.default) and ran initialize:

  • Accept: application/json, text/event-stream200 OK (SSE stream, initialize responds correctly)
  • Accept: application/json (only) → 406 Not Acceptable (identical to the playground error)

So the endpoint itself is healthy and MCP-compliant. The failure is in the portal runtime client for the native Foundry IQ attachment, which sends Accept: application/json without text/event-stream.

The connection the portal creates for the native attach looks correct per the docs: metadata.type = knowledgeBase_MCP, authType = ProjectManagedIdentity, audience = https://search.azure.com (the project managed identity has Search Index Data Reader on the search service).

Workaround I found (works, but feels unsupported)

  1. Remove the Foundry IQ attachment under Knowledge.
  2. Add the same endpoint as a Custom MCP (Tools > Add > Model Context Protocol). This client (metadata.type = custom_MCP) does send both Accept headers, so it passes the 406.
  3. The Microsoft Entra auth option on that flow creates authType = AgenticIdentityToken, which has no role on Search → 403. I had to change the connection to authType = ProjectManagedIdentity (keeping audience = https://search.azure.com) via az rest PUT on the connection, since the portal doesn't expose that change.

After that, asking the agent a question lists and calls knowledge_base_retrieve correctly end to end.

Questions

  1. Is the 406 in the native Knowledge > Add (Foundry IQ / knowledgeBase_MCP) path a known bug in the current preview (missing text/event-stream in the client's Accept header)? Is a fix planned?
  2. Is there a supported configuration to make the native Foundry IQ attachment work with a no-code Prompt Agent, so I don't need the custom-MCP + az rest workaround?
  3. Is the custom_MCP + ProjectManagedIdentity approach a supported pattern for connecting a Foundry IQ Knowledge Base to a Prompt Agent, or will it break with future changes?

Thanks!The error happens while the agent tries to enumerate the KB's MCP tools, so the agent never reaches knowledge_base_retrieve and can't answer anything grounded on the knowledge base.

Environment

  • Microsoft Foundry Agent Service, no-code Prompt Agent (portal, ai.azure.com)
  • Foundry IQ Knowledge Base built on Azure AI Search (Standard tier), hybrid + semantic retrieval, system-assigned managed-identity auth, indexing blob documents
  • KB chat model: gpt-5.4-mini; vectorizer: text-embedding-ada-002
  • Foundry project region: Sweden Central; Azure AI Search region: France Central
  • MCP API version: 2026-05-01-preview

What I expected

Asking the Prompt Agent a question should trigger the KB's managed MCP tool (knowledge_base_retrieve) and return a grounded answer with citations, as described in the Foundry IQ docs.

What actually happens

Every prompt fails immediately with the 406 above — the agent can't list its tools, so it never calls the knowledge base. I traced the root cause to a missing Accept header in the internal MCP client used by the native Knowledge attachment.

Isolation / evidence (direct probe of the KB MCP endpoint)

I called the KB MCP endpoint directly (.../knowledgebases/<kb-name>/mcp?api-version=2026-05-01-preview, bearer token for audience https://search.azure.com/.default) and ran initialize:

  • Accept: application/json, text/event-stream200 OK (SSE stream, initialize responds correctly)
  • Accept: application/json (only) → 406 Not Acceptable (identical to the playground error)

So the endpoint itself is healthy and MCP-compliant. The failure is in the portal runtime client for the native Foundry IQ attachment, which sends Accept: application/json without text/event-stream.

The connection the portal creates for the native attach looks correct per the docs: metadata.type = knowledgeBase_MCP, authType = ProjectManagedIdentity, audience = https://search.azure.com (the project managed identity has Search Index Data Reader on the search service).

Workaround I found (works, but feels unsupported)

  1. Remove the Foundry IQ attachment under Knowledge.
  2. Add the same endpoint as a Custom MCP (Tools > Add > Model Context Protocol). This client (metadata.type = custom_MCP) does send both Accept headers, so it passes the 406.
  3. The Microsoft Entra auth option on that flow creates authType = AgenticIdentityToken, which has no role on Search → 403. I had to change the connection to authType = ProjectManagedIdentity (keeping audience = https://search.azure.com) via az rest PUT on the connection, since the portal doesn't expose that change.

After that, asking the agent a question lists and calls knowledge_base_retrieve correctly end to end.

Questions

  1. Is the 406 in the native Knowledge > Add (Foundry IQ / knowledgeBase_MCP) path a known bug in the current preview (missing text/event-stream in the client's Accept header)? Is a fix planned?
  2. Is there a supported configuration to make the native Foundry IQ attachment work with a no-code Prompt Agent, so I don't need the custom-MCP + az rest workaround?
  3. Is the custom_MCP + ProjectManagedIdentity approach a supported pattern for connecting a Foundry IQ Knowledge Base to a Prompt Agent, or will it break with future changes?

Thanks!

Foundry Agent Service
Foundry Agent Service

A fully managed platform in Microsoft Foundry for hosting, scaling, and securing AI agents built with any supported framework or model

0 comments No comments

1 answer

Sort by: Most helpful
  1. Thanmayi Godithi 11,825 Reputation points Microsoft External Staff Moderator
    2026-09-01T15:28:49.3933333+00:00

    Hello Angel Sevillano ,

    Thank you for the detailed investigation and for sharing the repro steps.

    Based on the information provided, we can see that the MCP endpoint itself is responding as expected when the request includes both application/json and text/event-stream in the Accept header. Additionally, the behaviour you observed where requests containing only application/json return 406 Not Acceptable is consistent with the error encountered from the Prompt Agent runtime.

    From the information available, we are unable to confirm whether this is a known issue with the native Knowledge > Add (knowledgeBase_MCP) integration or whether a fix has been scheduled. However, the evidence collected suggests that the failure occurs during MCP tool discovery prior to invocation of knowledge_base_retrieve, rather than with the Knowledge Base endpoint itself.

    Regarding the workaround, it's encouraging that configuring the endpoint as a Custom MCP connection and using ProjectManagedIdentity authentication allowed the agent to successfully enumerate tools and invoke knowledge_base_retrieve. However, since this approach requires configuration changes outside the standard portal experience, we cannot confirm whether it is a formally supported long-term configuration.

    I've shared the details from your investigation with the engineering team for further review. At this time, we recommend using the workaround only for testing purposes while we seek clarification on the expected behaviour of the native Foundry IQ attachment flow.

    Thank you again for providing such comprehensive diagnostics, as they are very helpful for the investigation.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.