langchain-ai/deepagents · error · ToolRequirementIntrospectionError

uv tool receipt is missing `[tool]`

Error message

uv tool receipt is missing `[tool]`

What it means

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.

Source

Thrown at libs/code/deepagents_code/update_check.py:3001

        tool_root: Optional uv tool environment root. Defaults to `sys.prefix`.
        data: Optional pre-parsed receipt contents. Supplied by callers that
            read several receipt fields at once so the file is parsed once
            rather than per field.

    Returns:
        The recorded `[tool].python` value, or `None` when the receipt does not
            pin an interpreter.

    Raises:
        ToolRequirementIntrospectionError: If the receipt cannot be read, parsed,
            or safely re-expressed as a `--python` value.
    """
    if data is None:
        data = _uv_tool_receipt_data(tool_root)
    tool = data.get("tool")
    if not isinstance(tool, dict):
        msg = "uv tool receipt is missing `[tool]`"
        raise ToolRequirementIntrospectionError(msg)
    python = tool.get("python")
    if python is None:
        return None
    if not isinstance(python, str) or not python:
        msg = "uv tool receipt contains an invalid `[tool].python` value"
        raise ToolRequirementIntrospectionError(msg)
    return python


def _uv_tool_selected_extras(
    *,
    distribution_name: str = "deepagents-code",
    tool_root: Path | None = None,
    data: dict[str, Any] | None = None,
) -> set[NormalizedName]:
    """Return extras explicitly selected on the uv tool requirement.

    Args:

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Regenerate the receipt: `uv tool install deepagents-code --force`.
  2. Confirm the file is the uv receipt (contains `[tool]`) and not another TOML at that path.
  3. Upgrade uv and reinstall the tool if the receipt format comes from a mismatched uv version.

Example fix

// before: receipt without [tool]
 [metadata]
 version = 1
// after: regenerated by uv
 [tool]
 python = "3.12"
 [[tool.requirements]]
 name = "deepagents-code"
Defensive patterns

Strategy: validation

Validate before calling

import tomllib

def has_tool_table(data: dict) -> bool:
    return isinstance(data.get('tool'), dict)

Type guard

def is_receipt_with_tool(data: object) -> bool:
    return isinstance(data, dict) and isinstance(data.get('tool'), dict)

Try / catch

try:
    python = _uv_tool_python()
except ToolRequirementIntrospectionError:
    python = None  # fall back to the ambient interpreter

Prevention

When it happens

Trigger: _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.

Common situations: 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.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29). Data as JSON: /api/errors/690a736acf4d841f. Report an issue: GitHub.