{"record":{"id":"96f563d85bd63ed5","repo":"langchain-ai/deepagents","slug":"marketplace-manifest-manifest-path-must-be-a-jso","errorCode":null,"errorMessage":"Marketplace manifest {manifest_path} must be a JSON object","messagePattern":"Marketplace manifest (.+?) must be a JSON object","errorType":"exception","errorClass":"MarketplaceError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/plugins/marketplace.py","lineNumber":814,"sourceCode":"        author=author,\n        display_name=(\n            display_name_value if isinstance(display_name_value, str) else None\n        ),\n    )\n\n\ndef _load_marketplace_from_path(root: Path, manifest_path: Path) -> PluginMarketplace:\n    try:\n        raw = json.loads(manifest_path.read_text(encoding=\"utf-8\"))\n    except json.JSONDecodeError as exc:\n        msg = f\"Invalid JSON syntax in {manifest_path}: {exc}\"\n        raise MarketplaceError(msg) from exc\n    except OSError as exc:\n        msg = f\"Could not read marketplace manifest {manifest_path}: {exc}\"\n        raise MarketplaceError(msg) from exc\n    if not isinstance(raw, dict):\n        msg = f\"Marketplace manifest {manifest_path} must be a JSON object\"\n        raise MarketplaceError(msg)\n    try:\n        name = _validate_name(raw.get(\"name\"), allow_at=False)\n    except ValueError as exc:\n        raise MarketplaceError(str(exc)) from exc\n    plugins_raw = raw.get(\"plugins\")\n    if not isinstance(plugins_raw, list):\n        msg = f\"Marketplace {name} must contain a plugins array\"\n        raise MarketplaceError(msg)\n    warnings: list[str] = []\n    plugins = tuple(\n        plugin\n        for entry in plugins_raw\n        if (plugin := _parse_entry(entry, warnings=warnings)) is not None\n    )\n    for warning in warnings:\n        logger.warning(\"%s\", warning)\n    metadata = json_object(raw.get(\"metadata\"))\n    return PluginMarketplace(","sourceCodeStart":796,"sourceCodeEnd":832,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/plugins/marketplace.py#L796-L832","documentation":"After successfully parsing the manifest JSON, _load_marketplace_from_path requires the top-level document to be a JSON object (dict). Lists, strings, or numbers at the top level cannot carry a marketplace definition, so a MarketplaceError is raised naming the manifest path.","triggerScenarios":"load_marketplace / _load_marketplace_file on a manifest whose root is not an object, e.g. the file contains `[...]`, `\"text\"`, or `null`.","commonSituations":"A manifest accidentally serialized as a JSON array of plugins; an empty file containing `null`; a tool exporting a list of marketplaces instead of a single marketplace object.","solutions":["Wrap the manifest content in a top-level object with `name` and `plugins` keys.","Validate the file with json.tool and confirm the outermost token is `{`.","Regenerate the manifest from the exporter with the correct single-object schema."],"exampleFix":"// before\n[\n  { \"id\": \"my-plugin\", \"source\": \"./plugins/a\" }\n]\n// after\n{\n  \"name\": \"team-market\",\n  \"plugins\": [ { \"id\": \"my-plugin\", \"source\": \"./plugins/a\" } ]\n}","handlingStrategy":"type-guard","validationCode":"import json\n\ndef manifest_root_is_object(path) -> bool:\n    raw = json.loads(path.read_text(encoding=\"utf-8\"))\n    return isinstance(raw, dict) and \"name\" in raw and isinstance(raw.get(\"plugins\"), list)","typeGuard":"from typing import TypeGuard\n\ndef is_marketplace_doc(raw: object) -> TypeGuard[dict]:\n    return isinstance(raw, dict)","tryCatchPattern":"try:\n    mp = load_marketplace(root)\nexcept MarketplaceError as exc:\n    if \"must be a JSON object\" in str(exc):\n        repair_manifest_schema(root)\n    raise","preventionTips":["Keep a JSON Schema for the manifest and validate with jsonschema in CI.","Never export bare arrays as manifests.","Add a lint step that checks top-level type before registering marketplaces."],"tags":["json","schema","marketplace","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}