{"record":{"id":"822775d0403a4bc8","repo":"langchain-ai/langchain","slug":"found-invalid-google-style-docstring","errorCode":null,"errorMessage":"Found invalid Google-Style docstring.","messagePattern":"Found invalid Google-Style docstring\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/core/langchain_core/utils/function_calling.py","lineNumber":769,"sourceCode":"            invalid.\n\n    Returns:\n        A tuple of the function description and a dictionary of argument descriptions.\n    \"\"\"\n    if docstring:\n        docstring_blocks = docstring.split(\"\\n\\n\")\n        if error_on_invalid_docstring:\n            filtered_annotations = {\n                arg\n                for arg in args\n                if arg not in {\"run_manager\", \"callbacks\", \"runtime\", \"return\"}\n            }\n            if filtered_annotations and (\n                len(docstring_blocks) < _MIN_DOCSTRING_BLOCKS\n                or not any(block.startswith(\"Args:\") for block in docstring_blocks[1:])\n            ):\n                msg = \"Found invalid Google-Style docstring.\"\n                raise ValueError(msg)\n        descriptors = []\n        args_block = None\n        past_descriptors = False\n        for block in docstring_blocks:\n            if block.startswith(\"Args:\"):\n                args_block = block\n                break\n            if block.startswith((\"Returns:\", \"Example:\")):\n                # Don't break in case Args come after\n                past_descriptors = True\n            elif not past_descriptors:\n                descriptors.append(block)\n            else:\n                continue\n        description = \" \".join(descriptors).strip()\n    else:\n        if error_on_invalid_docstring:\n            msg = \"Found invalid Google-Style docstring.\"","sourceCodeStart":751,"sourceCodeEnd":787,"githubUrl":"https://github.com/langchain-ai/langchain/blob/e32fa9a52eab3b61ad7a45399bfde59b3e580fc4/libs/core/langchain_core/utils/function_calling.py#L751-L787","documentation":"Error \"Found invalid Google-Style docstring.\" thrown in langchain-ai/langchain.","triggerScenarios":"Raised when parsing a Google-style docstring fails structurally (e.g. malformed Args section) while inferring a tool schema from a function.","commonSituations":"See trigger scenarios.","solutions":["Rewrite the docstring in valid Google style: summary line, then 'Args:' section with 'name: description' entries.","Run a Google-style docstring linter (e.g. pydocstyle with google convention) to find the malformed section."],"exampleFix":"def f(query: str) -> str:\n    \"\"\"Do a thing.\n\n    Args:\n        query: The user query.\n    \"\"\"","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e32fa9a52eab3b61ad7a45399bfde59b3e580fc4","analyzedAt":"2026-08-14T18:42:09.092Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}