{"record":{"id":"e725e5b636c97fee","repo":"langchain-ai/langgraph","slug":"a-tool-argument-should-not-be-annotated-with-inje","errorCode":null,"errorMessage":"A tool argument should not be annotated with {injection_type.__name__} more than once. Found: {matches}","messagePattern":"A tool argument should not be annotated with (.+?) more than once\\. Found: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/prebuilt/langgraph/prebuilt/tool_node.py","lineNumber":1957,"sourceCode":") -> Any | None:\n    \"\"\"Extract injection instance from a type annotation.\n\n    Args:\n        type_: The type annotation to check.\n        injection_type: The injection type to look for.\n\n    Returns:\n        The injection instance if found, True if injection marker found without instance, None otherwise.\n    \"\"\"\n    type_args = get_args(type_)\n    matches = [arg for arg in type_args if _is_injection(arg, injection_type)]\n\n    if len(matches) > 1:\n        msg = (\n            f\"A tool argument should not be annotated with {injection_type.__name__} \"\n            f\"more than once. Found: {matches}\"\n        )\n        raise ValueError(msg)\n\n    if len(matches) == 1:\n        return matches[0]\n    elif _is_injection(type_, injection_type):\n        return True\n\n    return None\n\n\ndef _get_all_injected_args(tool: BaseTool) -> _InjectedArgs:\n    \"\"\"Extract all injected arguments from tool in a single pass.\n\n    This function analyzes both the tool's input schema and function signature\n    to identify all arguments that should be injected (state, store, runtime).\n\n    Args:\n        tool: The tool to analyze for injection requirements.\n","sourceCodeStart":1939,"sourceCodeEnd":1975,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/prebuilt/langgraph/prebuilt/tool_node.py#L1939-L1975","documentation":"Error \"A tool argument should not be annotated with {injection_type.__name__} more than once. Found: {matches}\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/prebuilt/langgraph/prebuilt/tool_node.py:1957 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}