Skip to main content

Tool best practices for Microsoft Foundry Agent Service

When you build agents in Microsoft Foundry Agent Service, tools extend what your agent can do—retrieving information, calling APIs, and connecting to external services. This article helps you configure tools effectively, control when the model calls them, and keep your data secure.
In your agent instructions, describe what each tool is for and when to use it. For example:When you need information from my indexed documents, use File Search. When you need to call an API, use the OpenAPI tool. When a tool call fails or returns no results, explain what happened and ask a follow-up question.

Prerequisites

  • Access to a Foundry project in the Foundry portal with the Azure AI Developer role or equivalent permissions.
  • A model deployed in the same project.
  • Any required connections configured for the tools you plan to use (for example, Azure AI Search, SharePoint, or Bing grounding).

Configure and validate tool usage

Improve tool-calling reliability

Control tool calling with tool_choice

Use tool_choice for the most deterministic control over tool calling.
  • auto: The model decides whether to call tools.
  • required: The model must call one or more tools.
  • none: The model doesn’t call tools.
For details, see tool_choice in Foundry project REST (preview).

Write effective tool instructions

  • Keep instructions specific and consistent with your tool setup.
  • Tell the model what each tool is for.
  • If you have multiple tools that overlap, add a decision rule (for example, “Use File Search before Web Search for internal content.”).

Secure tool usage

Tools send and receive data outside the model. Reduce security and privacy risks with these practices:
  • Treat tool outputs as untrusted input and validate critical values before acting on them.
  • Send only the information required to complete the task.
  • Don’t include keys, tokens, or other credentials in prompts.
  • Avoid logging secrets in traces or application logs.
  • If you connect to non-Microsoft services (for example, third-party MCP servers), review the considerations in Discover and manage tools in the Foundry tool catalog (preview).
  • If you need centralized routing and policy enforcement for MCP tools, see Tools governance with AI Gateway (preview).

Tool support by region and model

Region and model determine which tools are available to your agent.
In the tables below: Yes means fully supported, No means not supported, and Limited means partial support that varies by tool configuration. Check individual tool documentation for details.
The following table shows tool availability by region.
This region availability table only accounts for service availability. You need to make sure the model you want to use is also available in the same region.
Region NameAgent2AgentAzure AI SearchBrowser AutomationCode InterpreterComputer UseFabric Data AgentFile SearchFunctionGrounding with Bing Custom SearchGrounding with Bing SearchImage GenerationMCPOpenAPISharePointWeb Search
australiaeastyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
brazilsouthyesyesyesyesnoyesyesnoyesyesyesyesyesyesyes
canadaeastyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
eastusyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
eastus2yesyesyesyesyesyesyesyesyesyesyesyesyesyesyes
francecentralyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
germanywestcentralyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
italynorthyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
japaneastyesyesyesnonoyesyesyesyesyesyesyesyesyesyes
koreacentralyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
northcentralusyesyesyesyesnoyesyesnoyesyesyesyesyesyesyes
norwayeastyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
polandcentralyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
southafricanorthyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
southcentralusyesyesyesnonoyesyesnoyesyesyesyesyesyesyes
southeastasiayesyesyesnonoyesyesyesyesyesyesyesyesyesyes
southindiayesyesyesyesyesyesyesyesyesyesyesyesyesyesyes
spaincentralyesyesyesnonoyesyesyesyesyesyesyesyesyesyes
swedencentralyesyesyesyesyesyesyesyesyesyesyesyesyesyesyes
switzerlandnorthyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
uaenorthyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
uksouthyesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
westusyesyesyesyesnoyesyesnoyesyesyesyesyesyesyes
westus3yesyesyesyesnoyesyesyesyesyesyesyesyesyesyes
Tools are supported by the following models.
For the image generation tool, you need both the gpt-image-1 model and a large language model (LLM) as the orchestrator in the same Microsoft Foundry project.
Modelagent2agentAzure AI SearchBrowser AutomationCode InterpreterComputer UseFabric Data AgentFile SearchFunctionGrounding Bing CustomGrounding Bing SearchImage GenerationMCPOpenAPISharePointWeb Search
gpt-5YesYesYesYesNoYesYesYesYesYesYesYesYesYesYes
gpt-5-miniYesYesYesYesNoYesYesYesYesYesYesYesYesYesYes
gpt-5-nanoYesYesYesYesNoYesYesYesYesYesYesYesYesYesYes
gpt-5-chatNoNoNoNoNoNoYesNoNoNoNoNoNoNoNo
gpt-5-proYesYesYesNoNoYesYesYesYesYesYesYesYesYesYes
o4-miniYesYesYesYesNoYesYesYesYesYesYesYesYesYesYes
o3YesYesYesYesNoYesYesYesYesYesYesYesYesYesYes
o3-miniYesYesYesNoNoYesYesYesYesYesNoYesYesYesYes
o1YesYesYesNoNoYesYesYesYesYesNoYesYesYesYes
computer-use-previewNoNoNoNoYesNoNoNoNoNoNoNoNoNoNo
gpt-4.1YesYesYesYesNoYesYesYesYesYesYesYesYesYesYes
gpt-4.1-miniYesYesYesYesNoYesYesYesYesYesYesYesYesYesYes
gpt-4.1-nanoYesYesYesYesNoYesYesYesYesYesYesYesYesYesYes
gpt-4oYesYesYesYesNoYesYesYesYesYesYesYesYesYesYes
gpt-4o-miniYesYesYesYesNoYesYesYesYesYesYesYesYesYesYes
gpt-image-1NoNoNoNoNoNoNoNoNoNoYesNoNoNoNo
DeepSeek-V3.0324NoLimitedNoYesNoLimitedYesYesLimitedLimitedNoLimitedNoLimitedNo
DeepSeek-V3.1NoLimitedNoYesNoLimitedNoNoLimitedLimitedNoLimitedNoLimitedNo
Llama-3.3-70B-InstructNoNoNoYesNoNoYesNoNoNoNoNoNoNoNo
Llama-4-Maverick-178-128E-InstrNoLimitedNoNoNoLimitedYesYesLimitedLimitedNoLimitedNoLimitedNo
grok-3-miniNoLimitedNoNoNoLimitedNoYesLimitedLimitedNoLimitedNoLimitedNo
grok-4-fast-non-reasoningNoLimitedNoNoNoLimitedNoYesLimitedLimitedNoLimitedNoLimitedNo
grok-4-fast-reasoningNoLimitedNoNoNoLimitedNoYesLimitedLimitedNoLimitedNoLimitedNo

Troubleshooting

Use these checks to resolve common issues:
  • Your agent doesn’t call a tool:
    • Confirm the tool is attached to the agent.
    • Confirm the model supports the tool.
    • If you need deterministic behavior, set tool_choice to required.
    • Review run traces to confirm whether the model produced a tool call.
  • Tool calls return empty or irrelevant results:
    • Improve tool descriptions and agent instructions.
    • For retrieval tools, ensure your data is ingested and searchable.
  • Tool calls fail:
    • Verify tool configuration and authentication.
    • For MCP and OpenAPI tools, validate the endpoint is reachable and returns expected responses.

FAQ

How do I validate whether a tool was called? Review run traces to confirm whether your agent called a tool and to inspect tool inputs and outputs. For end-to-end tracing setup, see Trace your application. How do I make tool usage more reliable? Start with clear tool instructions. If you need deterministic tool calling, use tool_choice. For details, see Control tool calling with tool_choice.

Tool management

Retrieval and search tools

Data and integration tools

Automation and generation tools