{"record":{"id":"1a0d92093069fe6c","repo":"langchain-ai/deepagents","slug":"source-display-path-path-tools-index-mu","errorCode":null,"errorMessage":"{source}: {_display_path(path)}: tools[{index}] must be an object","messagePattern":"(.+?): (.+?): tools\\[(.+?)\\] must be an object","errorType":"error_code","errorClass":"FleetImportError","httpStatus":null,"severity":"error","filePath":"libs/talon/deepagents_talon/fleet_import.py","lineNumber":374,"sourceCode":"    except OSError as exc:\n        msg = f\"{source}: {_display_path(path)}: {exc}\"\n        raise FleetImportError(msg) from exc\n    if not isinstance(data, dict):\n        msg = f\"{source}: {_display_path(path)}: malformed tools.json: expected object\"\n        raise FleetImportError(msg)\n\n    raw_tools = data.get(\"tools\")\n    if not isinstance(raw_tools, list):\n        msg = f\"{source}: {_display_path(path)}: malformed tools.json: expected tools list\"\n        raise FleetImportError(msg)\n    interrupt_config = data.get(\"interrupt_config\")\n    interrupts = interrupt_config if isinstance(interrupt_config, dict) else {}\n\n    requests: list[_ToolRequest] = []\n    for index, item in enumerate(raw_tools):\n        if not isinstance(item, dict):\n            msg = f\"{source}: {_display_path(path)}: tools[{index}] must be an object\"\n            raise FleetImportError(msg)\n        tool = cast(\"Mapping[str, object]\", item)\n        name = _required_str(tool, \"name\", path, index, source)\n        server_url = _sanitize_server_url(\n            _required_str(tool, \"mcp_server_url\", path, index, source)\n        )\n        server_name = _required_str(tool, \"mcp_server_name\", path, index, source)\n        requests.append(\n            _ToolRequest(\n                name=name,\n                server_url=server_url,\n                server_name=server_name,\n                scope=scope,\n                interrupt=_tool_interrupt_enabled(tool, interrupts, name, server_url, server_name),\n            )\n        )\n    return requests\n\n","sourceCodeStart":356,"sourceCodeEnd":392,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/talon/deepagents_talon/fleet_import.py#L356-L392","documentation":"FleetImportError raised when an element of the tools list in tools.json is not a JSON object. Each entry of the 'tools' array must be a mapping of tool fields (name, mcp_server_url, mcp_server_name).","triggerScenarios":"A tools.json entry like \"tools\": [\"name-only\"] or [123] or [null]; iterating raw_tools with enumerate hits a non-dict item at the reported index.","commonSituations":"Hand-editing the list and dropping braces around an entry; JSON minifiers or scripts emitting scalars; copy-paste losing the object structure of one tool.","solutions":["Fix the array element at the reported index so it is a JSON object with name, mcp_server_url, and mcp_server_name fields","Re-export the fleet tools.json from source if it was generated","Lint the file (e.g. jq '.tools | map(type)' tools.json) to find non-object entries"],"exampleFix":"// before\n{\"tools\": [\"my-tool\"]}\n// after\n{\"tools\": [{\"name\": \"my-tool\", \"mcp_server_url\": \"https://example.com\", \"mcp_server_name\": \"example\"}]}","handlingStrategy":"validation","validationCode":"data = json.loads(path.read_text())\nbad = [i for i, t in enumerate(data.get(\"tools\", [])) if not isinstance(t, dict)]\nif bad:\n    raise ValueError(f\"non-object tool entries at indexes {bad}\")","typeGuard":"def is_tool_entry(item: object) -> TypeGuard[dict[str, object]]:\n    return isinstance(item, dict)","tryCatchPattern":"try:\n    summaries = _mcp_summaries(...)\nexcept FleetImportError as exc:\n    logger.error(\"Bad tool entry in tools.json: %s\", exc)\n    raise","preventionTips":["Run jq '.tools | map(type)' to verify all entries are objects","Never hand-edit generated tools.json entries","Round-trip parse the file before import"],"tags":["json","config","validation","mcp"],"backgroundTag":"schema-validation-failed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}