{"record":{"id":"77deb03ec42bb735","repo":"deepset-ai/haystack","slug":"type-chat-generator-name-does-not-accept-to","errorCode":null,"errorMessage":"{type(chat_generator).__name__} does not accept tools parameter in its run method. The Agent component requires a chat generator that supports tools when tools are provided.","messagePattern":"(.+?) does not accept tools parameter in its run method\\. The Agent component requires a chat generator that supports tools when tools are provided\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"haystack/components/agents/agent.py","lineNumber":464,"sourceCode":"              Agent running by setting the `continue_run` control flag (`state.set(\"continue_run\", True)`), usually\n              alongside a message telling the model what to do next. \"on_exit\" hooks run when the Agent stops on an\n              exit condition, but not when it stops because `max_agent_steps` is reached.\n            - \"after_run\": Runs once per run, after the step loop has ended and before the Agent builds its return\n              value — regardless of whether the run stopped on an exit condition or because `max_agent_steps` was\n              reached (unlike \"on_exit\"). Mutations to the state (e.g. appending a final message) are reflected in\n              the returned `messages` / `last_message` and `state_schema` outputs. Setting `continue_run` here has\n              no effect.\n        :raises TypeError: If the chat_generator does not support tools parameter in its run method.\n        :raises ValueError: If any `user_prompt` variable overlaps with the `state_schema` or `run` method parameters,\n            if a hook is registered under an unknown hook point, or if a hook is registered under a hook point it does\n            not support (via its `allowed_hook_points`).\n        \"\"\"\n        # --- Validation ---\n        self._chat_generator_supports_tools: bool = \"tools\" in inspect.signature(chat_generator.run).parameters\n        # We use an explicit None check for tools b/c testing for truthiness calls __len__, which for SearchableToolset\n        # would iterate and prematurely warm it up at init.\n        if tools is not None and not self._chat_generator_supports_tools:\n            raise TypeError(\n                f\"{type(chat_generator).__name__} does not accept tools parameter in its run method. \"\n                \"The Agent component requires a chat generator that supports tools when tools are provided.\"\n            )\n\n        if exit_conditions is None:\n            exit_conditions = [\"text\"]\n\n        if state_schema is not None:\n            reserved_keys = _RUN_METADATA_STATE_KEYS.keys() | _INTERNAL_STATE_KEYS.keys()\n            reserved_used = sorted(set(state_schema) & reserved_keys)\n            if reserved_used:\n                raise ValueError(\n                    f\"state_schema keys {reserved_used} are reserved for Agent internal state and \"\n                    f\"cannot be redefined. Reserved keys: {sorted(reserved_keys)}.\"\n                )\n            _validate_schema(state_schema)\n        _validate_prompt_message_blocks(user_prompt, system_prompt)\n        if tool_concurrency_limit < 1:","sourceCodeStart":446,"sourceCodeEnd":482,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/components/agents/agent.py#L446-L482","documentation":"warm_up builds a dict keyed by skill name; skill names must be unique across the store. This ValueError is raised when two skill files resolve to the same name — either both declare the same 'name' in frontmatter, or one's frontmatter name collides with another skill's directory name (used as fallback when 'name' is absent).","triggerScenarios":"Two .md skill files in skills_dir declaring 'name: my-skill'; or skill dirs 'foo/' and 'bar/' where bar/SKILL.md declares 'name: foo'. Detected during warm_up via list_skills/load_skill.","commonSituations":"Copying a skill directory to iterate on it without changing the frontmatter 'name'; a nested directory plus a top-level skill sharing the frontmatter name; symlinks or duplicated skills checked into the repo twice.","solutions":["Rename the 'name' field in one of the colliding skills' frontmatter so each name is unique.","If the collision comes from directory-name fallback, either set an explicit unique 'name' or rename the skill directory.","Remove duplicate/copied skill directories or symlinks from skills_dir."],"exampleFix":"// before (skills/backup/SKILL.md and skills/backup-v2/SKILL.md)\nname: backup\n// after (backup-v2/SKILL.md)\nname: backup-v2","handlingStrategy":"validation","validationCode":"import yaml\nfrom pathlib import Path\nfrom collections import Counter\n\ndef find_duplicate_skill_names(skills_dir: Path) -> list[str]:\n    names = []\n    for md in skills_dir.glob(\"**/*.md\"):\n        lines = md.read_text(encoding=\"utf-8\").splitlines()\n        if lines and lines[0].strip() == \"---\":\n            closing = lines.index(\"---\", 1)\n            fm = yaml.safe_load(\"\\n\".join(lines[1:closing])) or {}\n            names.append(fm.get(\"name\", md.parent.name))\n    return [n for n, c in Counter(names).items() if c > 1]","typeGuard":null,"tryCatchPattern":"try:\n    store.list_skills()\nexcept ValueError as e:\n    if \"Duplicate skill name\" in str(e):\n        logger.error(\"Rename one of the colliding skills: %s\", e)\n    raise","preventionTips":["When copying a skill to iterate, immediately change its frontmatter 'name'","Keep skill directory names and frontmatter names identical to avoid fallback collisions","Run a duplicate-name check over skills_dir in CI"],"tags":["skill-store","duplicate","configuration","naming"],"backgroundTag":"duplicate-identifier","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}