{"record":{"id":"5c81cbcba88c5b84","repo":"microsoft/autogen","slug":"unsupported-tool-string-tool","errorCode":null,"errorMessage":"Unsupported tool string: {tool}","messagePattern":"Unsupported tool string: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/agents/azure/_azure_ai_agent.py","lineNumber":437,"sourceCode":"        if tools is None:\n            return\n\n        for tool in tools:\n            if isinstance(tool, str):\n                if tool == \"file_search\":\n                    converted_tools.append(FileSearchToolDefinition())\n                elif tool == \"code_interpreter\":\n                    converted_tools.append(CodeInterpreterToolDefinition())\n                elif tool == \"bing_grounding\":\n                    converted_tools.append(BingGroundingToolDefinition())  # type: ignore\n                elif tool == \"azure_ai_search\":\n                    converted_tools.append(AzureAISearchToolDefinition())\n                elif tool == \"azure_function\":\n                    converted_tools.append(AzureFunctionToolDefinition())  # type: ignore\n                # elif tool == \"sharepoint_grounding\":\n                #     converted_tools.append(SharepointToolDefinition())  # type: ignore\n                else:\n                    raise ValueError(f\"Unsupported tool string: {tool}\")\n            elif isinstance(tool, ToolDefinition):\n                converted_tools.append(tool)\n            elif isinstance(tool, Tool):\n                self._original_tools.append(tool)\n                converted_tools.append(self._convert_tool_to_function_tool_definition(tool))\n            elif callable(tool):\n                if hasattr(tool, \"__doc__\") and tool.__doc__ is not None:\n                    description = tool.__doc__\n                else:\n                    description = \"\"\n                function_tool = FunctionTool(tool, description=description)\n                self._original_tools.append(function_tool)\n                converted_tools.append(self._convert_tool_to_function_tool_definition(function_tool))\n            else:\n                raise ValueError(f\"Unsupported tool type: {type(tool)}\")\n\n    def _convert_tool_to_function_tool_definition(self, tool: Tool) -> FunctionToolDefinition:\n        \"\"\"","sourceCodeStart":419,"sourceCodeEnd":455,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/agents/azure/_azure_ai_agent.py#L419-L455","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Correct the string to one of the supported names: file_search, code_interpreter, bing_grounding, azure_ai_search, azure_function.","For custom capabilities, pass a FunctionTool/Tool instance or a plain callable instead of a string name.","Check the installed version's source for the currently supported list (the elif chain in _convert_tools) — it changes between releases.","Note sharepoint_grounding is disabled in this version; remove it."],"exampleFix":"# before\ntools=[\"file-search\"]\n# after\ntools=[\"file_search\"]","handlingStrategy":"validation","validationCode":"SUPPORTED_TOOL_STRINGS = {\"file_search\",\"code_interpreter\",\"bing_grounding\",\"azure_ai_search\",\"azure_function\"}\nbad = [t for t in tools if isinstance(t, str) and t not in SUPPORTED_TOOL_STRINGS]\nif bad:\n    raise ValueError(f\"Unknown tool strings: {bad}\")","typeGuard":"def is_supported_tool_entry(tool) -> bool:\n    if isinstance(tool, str):\n        return tool in {\"file_search\",\"code_interpreter\",\"bing_grounding\",\"azure_ai_search\",\"azure_function\"}\n    return isinstance(tool, (ToolDefinition, Tool)) or callable(tool)","tryCatchPattern":"try:\n    agent = AzureAIAgent(client, tools=tools)\nexcept ValueError as e:\n    # e names the unsupported string; fix or drop it and rebuild\n    ...","preventionTips":["Use exact snake_case names; check the elif chain in your installed version for the supported set.","Express custom capabilities as FunctionTool/callables, not invented string names.","Unit-test your tool list against the supported names before agent construction."],"tags":["azure","tools","configuration","azure-ai-agent"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}