{"record":{"id":"dee40e43e8da5ec4","repo":"deepset-ai/haystack","slug":"invalid-search-tool-parameters-description-keys","errorCode":null,"errorMessage":"Invalid search_tool_parameters_description keys: {invalid_keys}. Valid keys are: {self._VALID_SEARCH_TOOL_PARAMS}","messagePattern":"Invalid search_tool_parameters_description keys: (.+?)\\. Valid keys are: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"haystack/tools/searchable_toolset.py","lineNumber":111,"sourceCode":"        :param search_tool_name: Custom name for the bootstrap search tool. Default is \"search_tools\".\n        :param search_tool_description: Custom description for the bootstrap search tool. If not provided, uses a\n            default description.\n        :param search_tool_parameters_description: Custom descriptions for the bootstrap search tool's parameters.\n            Keys must be a subset of `{\"tool_keywords\", \"k\"}`.\n            Example: `{\"tool_keywords\": \"Keywords to find tools, e.g. 'email send'\"}`\n        \"\"\"\n        valid_catalog = isinstance(catalog, Toolset) or (\n            isinstance(catalog, list) and all(isinstance(item, (Tool, Toolset)) for item in catalog)\n        )\n        if not valid_catalog:\n            raise TypeError(\n                f\"Invalid catalog type: {type(catalog)}. Expected Tool, Toolset, or list of Tools and/or Toolsets.\"\n            )\n\n        if search_tool_parameters_description is not None:\n            invalid_keys = set(search_tool_parameters_description.keys()) - self._VALID_SEARCH_TOOL_PARAMS\n            if invalid_keys:\n                raise ValueError(\n                    f\"Invalid search_tool_parameters_description keys: {invalid_keys}. \"\n                    f\"Valid keys are: {self._VALID_SEARCH_TOOL_PARAMS}\"\n                )\n\n        # Store raw catalog; flattening is deferred to warm_up() so that lazy toolsets\n        # (e.g. MCPToolset with eager_connect=False) can connect first.\n        self._raw_catalog: \"ToolsType\" = catalog\n        self._catalog: list[Tool] = []\n\n        self._top_k = top_k\n        self._search_threshold = search_threshold\n        self._search_tool_name = search_tool_name\n        self._search_tool_description = search_tool_description\n        self._search_tool_parameters_description = search_tool_parameters_description\n\n        # Runtime state (initialized in warm_up)\n        self._discovered_tools: dict[str, Tool] = {}\n        self._bootstrap_tool: Tool | None = None","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/tools/searchable_toolset.py#L93-L129","documentation":"SearchableToolset accepts an optional search_tool_parameters_description dict whose keys are restricted to a fixed whitelist (_VALID_SEARCH_TOOL_PARAMS). Passing keys outside that set raises ValueError listing the invalid keys and the valid ones.","triggerScenarios":"SearchableToolset(catalog=..., search_tool_parameters_description={\"desc\": \"...\"}) or any misspelled/unexpected key not in _VALID_SEARCH_TOOL_PARAMS.","commonSituations":"Typo in a key name (e.g. 'descriptions' vs 'description'); guessing parameter names instead of checking the class constant; copying config from a different toolset version with different keys.","solutions":["Use only keys in SearchableToolset._VALID_SEARCH_TOOL_PARAMS","Fix typos in the dict keys (the error message lists the valid set)","Check the SearchableToolset docstring/API docs for the accepted parameter-description keys"],"exampleFix":"// before\nSearchableToolset(catalog=tools, search_tool_parameters_description={\"description\": \"...\", \"keywords_hint\": \"...\"})\n\n// after\nSearchableToolset(catalog=tools, search_tool_parameters_description={\"description\": \"...\"})","handlingStrategy":"validation","validationCode":"VALID = SearchableToolset._VALID_SEARCH_TOOL_PARAMS\n\ndef clean_param_description(d: dict | None) -> dict | None:\n    if d is None:\n        return None\n    invalid = set(d) - VALID\n    if invalid:\n        raise ValueError(f\"Invalid keys {invalid}; valid: {VALID}\")\n    return d\n\nSearchableToolset(catalog=tools, search_tool_parameters_description=clean_param_description(desc))","typeGuard":"def has_only_valid_keys(d: dict | None) -> bool:\n    return d is None or set(d) <= set(SearchableToolset._VALID_SEARCH_TOOL_PARAMS)","tryCatchPattern":"try:\n    ts = SearchableToolset(catalog=tools, search_tool_parameters_description=desc)\nexcept ValueError as e:\n    logger.warning(\"Dropping invalid search_tool params: %s\", e)\n    ts = SearchableToolset(catalog=tools)","preventionTips":["Copy keys directly from SearchableToolset._VALID_SEARCH_TOOL_PARAMS rather than typing them","Centralize toolset config in one validated dict","Pin the haystack version so accepted keys don't drift unexpectedly"],"tags":["validation","configuration","toolset"],"backgroundTag":"invalid-configuration-key","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}