Share via

Foundry Agent Refusing to Use Tools

Abanes, Cameron A 20 Reputation points
2026-06-02T14:34:59.61+00:00

I am currently working an a foundry agent, but it is refusing to use any of the tools that I have connected to it. It previously was able to use these tools, and I haven't made any changes to its connectivity with them. I currently have a custom MCP server, a Azure Databricks Genie space and a knowledge base which points to several indexes in an Azure AI Search service.

Even when I explicitly instruct the agent to use these tools (ie "Dev: Use the xxxx-knowledge base to answer this question" or "use the MCP server to give me a reading on x") it does not use them. It'll actually make up readings and data, and when I point out that it's doing that it'll say something along the lines of "sorry, I'll use it next time". My instructions also explicitly state to only use tools, and if it can't to alert the user.

I have tried stripping back my instructions to see if it was too restrictive (namely safety & privacy & scope limitations, solely for testing purposes) but no luck.

When I send the initial prompt to the agent (ie "hello"), I can see under traces that there are three "mcp_list_tools" blocks that are called, each corresponding to one of my connected tools. Here is an example from one of them.

{
  "name": "mcp_list_tools",
  "context": {
    "trace_id": "conv_8e5aebf7b721ebc000XBNWPMtYxsUH5uBfnzvMPqvpEwVWmPIB",
    "span_id": "mcpl_8e5aebf7b721ebc0006a1ee6c118cc8190a1170ba1da2585ea",
    "conversation_id": "conv_8e5aebf7b721ebc000XBNWPMtYxsUH5uBfnzvMPqvpEwVWmPIB"
  },
  "kind": "Tool",
  "parent_id": "resp_8e5aebf7b721ebc0006a1ee6c0a82c81908935d0951cf53615",
  "attributes": {
    "span_type": "Tool",
    "duration": 0,
    "type": "mcp_list_tools",
    "id": "mcpl_8e5aebf7b721ebc0006a1ee6c118cc8190a1170ba1da2585ea",
    "agent_reference": {
      "type": "agent_reference",
      "name": "XYZ",
      "version": "44"
    },
    "response_id": "resp_8e5aebf7b721ebc0006a1ee6c0a82c81908935d0951cf53615",
    "partition_key": "8e5aebf7b721ebc000",
    "server_label": "AzureDatabricksGenieCustom",
    "tools": []
  },
  "start_time": "2026-06-02T14:20:49.000Z",
  "end_time": "2026-06-02T14:20:49.000Z",
  "status": {
    "status_code": "OK"
  }
}

Copilot said that the "tools" brackets being empty could be a problem.

Has anyone else had a similar problem? Is there any way to test whether the connection to the tool itself is broken or if it's just a problem with agent instructions?

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform

0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-06-02T14:35:42.93+00:00

    The empty tools: [] in the mcp_list_tools trace indicates the agent is not seeing any tools from that MCP server (and likely from the other connections as well). In that state, the model has nothing it can call, so it falls back to answering from its own knowledge and “hallucinates”, even if instructions say to use tools.

    Use the following checks to isolate whether this is a connection/toolbox issue or an instruction/model issue.

    1. Verify the toolbox can see tools

    For MCP and other remote tools, tools/list returning zero tools is a primary symptom of connection or manifest issues.

    • If using the Foundry toolbox:
      • Call tools/list for the MCP server and Databricks Genie connection.
      • If tools/list returns zero tools for MCP or A2A tools, the likely cause is invalid or missing connection credentials for the remote MCP server or A2A agent.
      • Fix:
        • Verify the project_connection_id exists in the Foundry project and that credentials are correct.
        • Test connectivity by calling the MCP server directly with the same auth.
        • If using managed identity (PMI, agent identity, or MI), verify the correct RBAC role assignments for the caller on the target resource.

    For OpenAPI tools, if tools/list returns zero tools, validate the OpenAPI spec (must be valid OpenAPI 3.0/3.1 with proper paths, operationId, and parameter schemas).

    1. Fix MCP server definition issues

    If the MCP server is reachable but tools are not exposed correctly, Foundry can reject the tool schema.

    Common MCP issues:

    • "Invalid tool schema" occurs if:
      • The MCP server definition uses anyOf or allOf, or
      • A parameter accepts multiple types.
    • Fix:
      • Update the MCP server definition to avoid anyOf/allOf and multi-type parameters.
      • Redeploy and reattach the MCP server to the agent.
    1. Confirm MCP auth and project connection

    If the MCP server returns Unauthorized or Forbidden:

    • Confirm the MCP server supports the chosen authentication method.
    • Verify credentials stored in the project connection are valid and up to date.
    • For services like GitHub, use least-privilege tokens and rotate them regularly.
    1. Validate server_label and allowed_tools

    Even if the MCP server is connected, the model may not call tools if they are filtered out:

    • Ensure server_label and server_url in the MCP configuration match what the agent expects.
    • If allowed_tools is set:
      • Confirm the tool names exactly match what the MCP server exposes.
      • Tool names are case-sensitive and must follow the MCP specification (no whitespace or special characters).
      • Temporarily remove allowed_tools and re-run tools/list to confirm the full tool list.
    1. Check region/model support for tools

    If Foundry reports “tool not supported” or silently omits tools:

    • Tool availability requires support from both the model and the region.
    • Check the region availability table and the model support table; if either shows No for a tool, it cannot run.
    • Confirm the model is actually deployed in the project and region being used.
    • If necessary, try a different region or a different model deployment that supports the required tools (for example, Code Interpreter is not available in some regions).
    1. Use tool_choice to force tool usage once tools are visible

    After confirming that tools/list returns the expected tools and traces show non-empty tools arrays:

    • Set tool_choice to required so the model must call one or more tools.
    • Keep instructions clear and specific about when to use each tool (for example, “Use the knowledge base for any question that requires indexed document content”).
    • Review run traces again to confirm tool calls and inspect tool inputs/outputs.
    1. Distinguish connection issues from instruction issues
    • If mcp_list_tools spans continue to show "tools": [], the problem is with tool discovery/connection (MCP server, Databricks Genie, or toolbox configuration), not instructions.
    • Once mcp_list_tools shows a non-empty tools list but the model still does not call tools:
      • Use tool_choice = required.
      • Simplify instructions to emphasize tool usage.
      • Confirm no conflicting settings (such as tool_choice = none).

    By first ensuring tools/list and mcp_list_tools return actual tools, then enforcing tool_choice = required, it becomes clear whether the issue is connectivity/toolbox configuration or agent behavior.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

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.