{"record":{"id":"690a736acf4d841f","repo":"langchain-ai/deepagents","slug":"uv-tool-receipt-is-missing-tool","errorCode":null,"errorMessage":"uv tool receipt is missing `[tool]`","messagePattern":"uv tool receipt is missing `\\[tool\\]`","errorType":"exception","errorClass":"ToolRequirementIntrospectionError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/update_check.py","lineNumber":3001,"sourceCode":"        tool_root: Optional uv tool environment root. Defaults to `sys.prefix`.\n        data: Optional pre-parsed receipt contents. Supplied by callers that\n            read several receipt fields at once so the file is parsed once\n            rather than per field.\n\n    Returns:\n        The recorded `[tool].python` value, or `None` when the receipt does not\n            pin an interpreter.\n\n    Raises:\n        ToolRequirementIntrospectionError: If the receipt cannot be read, parsed,\n            or safely re-expressed as a `--python` value.\n    \"\"\"\n    if data is None:\n        data = _uv_tool_receipt_data(tool_root)\n    tool = data.get(\"tool\")\n    if not isinstance(tool, dict):\n        msg = \"uv tool receipt is missing `[tool]`\"\n        raise ToolRequirementIntrospectionError(msg)\n    python = tool.get(\"python\")\n    if python is None:\n        return None\n    if not isinstance(python, str) or not python:\n        msg = \"uv tool receipt contains an invalid `[tool].python` value\"\n        raise ToolRequirementIntrospectionError(msg)\n    return python\n\n\ndef _uv_tool_selected_extras(\n    *,\n    distribution_name: str = \"deepagents-code\",\n    tool_root: Path | None = None,\n    data: dict[str, Any] | None = None,\n) -> set[NormalizedName]:\n    \"\"\"Return extras explicitly selected on the uv tool requirement.\n\n    Args:","sourceCodeStart":2983,"sourceCodeEnd":3019,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/update_check.py#L2983-L3019","documentation":"The receipt was loaded but has no `[tool]` table at the top level, so the pinned Python version cannot be read. _uv_tool_python requires data[\"tool\"] to be a dict before looking up the `python` key.","triggerScenarios":"_uv_tool_python is called (directly or via _uv_tool_install_command) with a parsed receipt dict whose top level lacks a dict-valued \"tool\" key.","commonSituations":"Receipt file replaced with a different/unrelated TOML; receipt written by a future uv with a changed layout; hand-editing that removed or renamed the [tool] section.","solutions":["Regenerate the receipt: `uv tool install deepagents-code --force`.","Confirm the file is the uv receipt (contains `[tool]`) and not another TOML at that path.","Upgrade uv and reinstall the tool if the receipt format comes from a mismatched uv version."],"exampleFix":"// before: receipt without [tool]\n [metadata]\n version = 1\n// after: regenerated by uv\n [tool]\n python = \"3.12\"\n [[tool.requirements]]\n name = \"deepagents-code\"","handlingStrategy":"validation","validationCode":"import tomllib\n\ndef has_tool_table(data: dict) -> bool:\n    return isinstance(data.get('tool'), dict)","typeGuard":"def is_receipt_with_tool(data: object) -> bool:\n    return isinstance(data, dict) and isinstance(data.get('tool'), dict)","tryCatchPattern":"try:\n    python = _uv_tool_python()\nexcept ToolRequirementIntrospectionError:\n    python = None  # fall back to the ambient interpreter","preventionTips":["Confirm the target file is a uv receipt (top-level [tool] table) before inspection.","Upgrade uv and reinstall the tool after uv version changes.","Never replace uv-receipt.toml with unrelated TOML.","Run `uv tool install deepagents-code --force` to restore structure."],"tags":["uv","receipt-schema","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}