{"record":{"id":"803fe110432d9929","repo":"microsoft/semantic-kernel","slug":"unable-to-create-azure-ai-tool-definition-because","errorCode":null,"errorMessage":"Unable to create Azure AI tool definition because of unsupported tool type: {tool.Type}, supported tool types are: {string.Join(\",\", s_validToolTypes)}","messagePattern":"Unable to create Azure AI tool definition because of unsupported tool type: (.+?), supported tool types are: (.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Agents/AzureAI/Extensions/AgentDefinitionExtensions.cs","lineNumber":61,"sourceCode":"    /// <param name=\"agentDefinition\">Agent definition</param>\n    /// <param name=\"kernel\">Kernel instance to associate with the agent.</param>\n    /// <exception cref=\"InvalidOperationException\"></exception>\n    public static IEnumerable<ToolDefinition> GetAzureToolDefinitions(this AgentDefinition agentDefinition, Kernel kernel)\n    {\n        Verify.NotNull(agentDefinition);\n\n        return agentDefinition.Tools?.Select<AgentToolDefinition, ToolDefinition>(tool =>\n        {\n            return tool.Type switch\n            {\n                AzureAISearchType => CreateAzureAISearchToolDefinition(tool),\n                AzureFunctionType => CreateAzureFunctionToolDefinition(tool),\n                BingGroundingType => CreateBingGroundingToolDefinition(tool, agentDefinition.GetProjectsClient(kernel)),\n                CodeInterpreterType => CreateCodeInterpreterToolDefinition(tool),\n                FileSearchType => CreateFileSearchToolDefinition(tool),\n                FunctionType => CreateFunctionToolDefinition(tool),\n                OpenApiType => CreateOpenApiToolDefinition(tool),\n                _ => throw new NotSupportedException($\"Unable to create Azure AI tool definition because of unsupported tool type: {tool.Type}, supported tool types are: {string.Join(\",\", s_validToolTypes)}\"),\n            };\n        }) ?? [];\n    }\n\n    /// <summary>\n    /// Return the Azure AI tool resources which corresponds with the provided <see cref=\"AgentDefinition\"/>.\n    /// </summary>\n    /// <param name=\"agentDefinition\">Agent definition</param>\n    public static ToolResources GetAzureToolResources(this AgentDefinition agentDefinition)\n    {\n        Verify.NotNull(agentDefinition);\n\n        var toolResources = new ToolResources();\n\n        var codeInterpreter = agentDefinition.GetCodeInterpreterToolResource();\n        if (codeInterpreter is not null)\n        {\n            toolResources.CodeInterpreter = codeInterpreter;","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Agents/AzureAI/Extensions/AgentDefinitionExtensions.cs#L43-L79","documentation":"Thrown by AzureAI AgentDefinitionExtensions.GetAzureToolDefinitions when an AgentToolDefinition.Type does not match any of the seven supported Azure AI tool types. The supported types are: azure_ai_search, azure_function, bing_grounding, code_interpreter, file_search, function, and openapi. The default case of the switch expression fires this NotSupportedException with the unsupported type and the list of valid types in the message.","triggerScenarios":"An agent definition specifies a tool with a Type string that is not one of the seven recognized Azure AI tool type constants. For example, a typo like \"code-interpreter\" (hyphen instead of underscore), a tool type from another platform (e.g., \"openai_retrieval\"), or a custom tool type not yet supported.","commonSituations":"Typo in tool type in the agent definition file. Using a tool type valid for OpenAI Assistant but not for Azure AI (or vice versa). Definition written for a different agent platform. SDK version that doesn't yet support a newer tool type. Case sensitivity issues (types are matched exactly).","solutions":["Check the error message which lists all supported types and fix the tool Type to one of them.","Use underscores not hyphens: e.g., 'code_interpreter' not 'code-interpreter'.","Verify the agent definition is intended for Azure AI agents, not another agent type.","If using a genuinely new tool type, check for an updated SDK version that adds support."],"exampleFix":"// before — definition has \"type\": \"code-interpreter\"\n// after — definition has \"type\": \"code_interpreter\"","handlingStrategy":"validation","validationCode":"var validTypes = new HashSet<string>(StringComparer.Ordinal)\n{\n    \"azure_ai_search\", \"azure_function\", \"bing_grounding\",\n    \"code_interpreter\", \"file_search\", \"function\", \"openapi\"\n};\nvar invalid = definition.Tools?.Where(t => !validTypes.Contains(t.Type)).ToList();\nif (invalid?.Count > 0)\n{\n    throw new ArgumentException(\n        $\"Unsupported tool types: {string.Join(\", \", invalid.Select(t => t.Type))}\");\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    var tools = definition.GetAzureToolDefinitions(kernel);\n}\ncatch (NotSupportedException ex)\n{\n    _logger.LogError(\"Unsupported Azure AI tool type: {Message}\", ex.Message);\n    throw;\n}","preventionTips":["Validate tool type strings at definition load time against the supported set.","Use underscores (code_interpreter) not hyphens (code-interpreter).","Keep tool type reference documentation handy when authoring definitions."],"tags":["azureai","tool-definition","notsupported","agent-definition"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}