microsoft/autogen · error · ValueError

Unsupported tool string: {tool}

Error message

Unsupported tool string: {tool}

What it means

Raised in AzureAIAgent's tool-conversion loop when a tool entry is a string that is not one of the supported built-in tool names: file_search, code_interpreter, bing_grounding, azure_ai_search, azure_function. String entries are treated as named Azure built-in tools, and unknown names fail fast.

Source

Thrown at python/packages/autogen-ext/src/autogen_ext/agents/azure/_azure_ai_agent.py:437

        if tools is None:
            return

        for tool in tools:
            if isinstance(tool, str):
                if tool == "file_search":
                    converted_tools.append(FileSearchToolDefinition())
                elif tool == "code_interpreter":
                    converted_tools.append(CodeInterpreterToolDefinition())
                elif tool == "bing_grounding":
                    converted_tools.append(BingGroundingToolDefinition())  # type: ignore
                elif tool == "azure_ai_search":
                    converted_tools.append(AzureAISearchToolDefinition())
                elif tool == "azure_function":
                    converted_tools.append(AzureFunctionToolDefinition())  # type: ignore
                # elif tool == "sharepoint_grounding":
                #     converted_tools.append(SharepointToolDefinition())  # type: ignore
                else:
                    raise ValueError(f"Unsupported tool string: {tool}")
            elif isinstance(tool, ToolDefinition):
                converted_tools.append(tool)
            elif isinstance(tool, Tool):
                self._original_tools.append(tool)
                converted_tools.append(self._convert_tool_to_function_tool_definition(tool))
            elif callable(tool):
                if hasattr(tool, "__doc__") and tool.__doc__ is not None:
                    description = tool.__doc__
                else:
                    description = ""
                function_tool = FunctionTool(tool, description=description)
                self._original_tools.append(function_tool)
                converted_tools.append(self._convert_tool_to_function_tool_definition(function_tool))
            else:
                raise ValueError(f"Unsupported tool type: {type(tool)}")

    def _convert_tool_to_function_tool_definition(self, tool: Tool) -> FunctionToolDefinition:
        """

View on GitHub (pinned to 027ecf0a37)

Solutions

  1. Correct the string to one of the supported names: file_search, code_interpreter, bing_grounding, azure_ai_search, azure_function.
  2. For custom capabilities, pass a FunctionTool/Tool instance or a plain callable instead of a string name.
  3. Check the installed version's source for the currently supported list (the elif chain in _convert_tools) — it changes between releases.
  4. Note sharepoint_grounding is disabled in this version; remove it.

Example fix

# before
tools=["file-search"]
# after
tools=["file_search"]
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED_TOOL_STRINGS = {"file_search","code_interpreter","bing_grounding","azure_ai_search","azure_function"}
bad = [t for t in tools if isinstance(t, str) and t not in SUPPORTED_TOOL_STRINGS]
if bad:
    raise ValueError(f"Unknown tool strings: {bad}")

Type guard

def is_supported_tool_entry(tool) -> bool:
    if isinstance(tool, str):
        return tool in {"file_search","code_interpreter","bing_grounding","azure_ai_search","azure_function"}
    return isinstance(tool, (ToolDefinition, Tool)) or callable(tool)

Try / catch

try:
    agent = AzureAIAgent(client, tools=tools)
except ValueError as e:
    # e names the unsupported string; fix or drop it and rebuild
    ...

Prevention

When it happens

Trigger: Passing tools=["web_search"], ["retrieval"], or a typo like ["file-search"] / ["code_interpreter2"] in the tools argument; sharepoint_grounding is commented out and also raises this error.

Common situations: Copy-pasting tool names from other SDKs (OpenAI Assistants naming, Semantic Kernel); version drift where a tool string supported in a fork/preview isn't in this release; typos and casing differences (names are matched exactly, lowercase with underscores).

Related errors


AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15). Data as JSON: /api/errors/5c81cbcba88c5b84. Report an issue: GitHub.