{"record":{"id":"29675824acd54f84","repo":"microsoft/semantic-kernel","slug":"unsupported-tool-type-spec-type-296758","errorCode":null,"errorMessage":"Unsupported tool type: {spec.type}","messagePattern":"Unsupported tool type: (.+?)","errorType":"exception","errorClass":"AgentInitializationException","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/agents/open_ai/openai_responses_agent.py","lineNumber":131,"sourceCode":"@_register_tool(\"web_search\")\ndef _web_search(spec: ToolSpec, kernel: Kernel | None = None) -> WebSearchToolParam:\n    options = spec.options or {}\n    context_size = options.get(\"search_context_size\")\n    user_location = options.get(\"user_location\")\n    return OpenAIResponsesAgent.configure_web_search_tool(\n        context_size=context_size,\n        user_location=user_location,\n    )\n\n\ndef _build_tool(spec: ToolSpec, kernel: \"Kernel\") -> ToolParam:\n    if not spec.type:\n        raise AgentInitializationException(\"Tool spec must include a 'type' field.\")\n\n    try:\n        builder = _TOOL_BUILDERS[spec.type.lower()]\n    except KeyError as exc:\n        raise AgentInitializationException(f\"Unsupported tool type: {spec.type}\") from exc\n\n    sig = inspect.signature(builder)\n    return builder(spec) if len(sig.parameters) == 1 else builder(spec, kernel)  # type: ignore[call-arg]\n\n\n# endregion\n\n\n# region Agent Thread\n\n\n@experimental\nclass ResponsesAgentThread(AgentThread):\n    \"\"\"Azure OpenAI and OpenAI Responses Agent Thread class.\"\"\"\n\n    def __init__(\n        self,\n        client: AsyncOpenAI,","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/agents/open_ai/openai_responses_agent.py#L113-L149","documentation":"Raised by _build_tool() when spec.type is present but not registered in _TOOL_BUILDERS (currently file_search and web_search). The lookup is case-insensitive; an unknown type raises KeyError which is wrapped in AgentInitializationException with the offending type name.","triggerScenarios":"Passing a tool type like 'code_interpreter' or 'retrieval' to a Responses agent (these belong to the Assistant API, not Responses); typos such as 'filesearch' or 'web-search'; a type only supported in a newer/older SK version.","commonSituations":"Copying Assistant-API tool types into a Responses agent spec; version mismatch where a tool type was renamed or not yet registered; typos; using an experimental tool not registered in this build.","solutions":["Use only supported Responses tool types: 'file_search' and 'web_search'.","Check spelling and casing matches the registered keys (case-insensitive but spelling must match).","Upgrade/downgrade SK to the version that registers the tool you need, or register a custom builder via _register_tool."],"exampleFix":"# before\ntool_spec = {'type': 'code_interpreter'}\n\n# after\ntool_spec = {'type': 'file_search', 'options': {'vector_store_ids': ['vs_x']}}","handlingStrategy":"validation","validationCode":"SUPPORTED = {'file_search', 'web_search'}\nassert spec['type'].lower() in SUPPORTED, f\"tool type {spec['type']!r} not supported; use one of {SUPPORTED}\"","typeGuard":"def is_supported_tool_type(spec: dict) -> bool:\n    return bool(spec.get('type')) and spec['type'].lower() in {'file_search', 'web_search'}","tryCatchPattern":"from semantic_kernel.exceptions.agent_exceptions import AgentInitializationException\ntry:\n    tool = _build_tool(tool_spec, kernel)\nexcept AgentInitializationException as e:\n    if 'Unsupported tool type' in str(e):\n        tool_spec['type'] = 'file_search'\n        tool = _build_tool(tool_spec, kernel)","preventionTips":["Use only file_search/web_search for Responses agents.","Check spelling/casing of types.","Register custom builders via _register_tool if needed."],"tags":["configuration","agents","openai-responses","tools","unsupported-type"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}