{"record":{"id":"b7203b63d4aaa30e","repo":"langchain-ai/deepagents","slug":"marketplace-name-must-contain-a-plugins-array","errorCode":null,"errorMessage":"Marketplace {name} must contain a plugins array","messagePattern":"Marketplace (.+?) must contain a plugins array","errorType":"exception","errorClass":"MarketplaceError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/plugins/marketplace.py","lineNumber":822,"sourceCode":"    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(\n        name=name,\n        root=root,\n        manifest_path=manifest_path,\n        metadata=metadata,\n        plugins=plugins,\n        warnings=tuple(warnings),\n    )\n","sourceCodeStart":804,"sourceCodeEnd":840,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/plugins/marketplace.py#L804-L840","documentation":"A valid marketplace manifest must contain a `plugins` key whose value is a JSON array. If `plugins` is missing or is not a list (e.g. a dict or string), MarketplaceError is raised with the marketplace's validated name in the message. Entries inside the array that fail parsing are skipped with warnings rather than raising.","triggerScenarios":"load_marketplace / _load_marketplace_file on a manifest where `plugins` is absent, set to an object `{}`, a string, or any non-list value.","commonSituations":"Hand-writing a manifest with `plugins: {}` keyed by plugin id; renaming the key (e.g. `plugin` singular); an upstream schema change in the manifest format; truncation dropping the array.","solutions":["Change `plugins` to a JSON array of plugin entry objects (or add the key if missing).","Check the manifest template/docs for the current schema and update the key name.","Re-pull the marketplace repo to restore the canonical manifest."],"exampleFix":"// before\n{ \"name\": \"team-corp\", \"plugins\": { \"a\": \"./plugins/a\" } }\n// after\n{ \"name\": \"team-corp\", \"plugins\": [ { \"id\": \"a\", \"source\": \"./plugins/a\" } ] }","handlingStrategy":"validation","validationCode":"import json\n\ndef plugins_is_array(path) -> bool:\n    doc = json.loads(path.read_text(encoding=\"utf-8\"))\n    plugins = doc.get(\"plugins\") if isinstance(doc, dict) else None\n    return isinstance(plugins, list) and all(isinstance(e, dict) for e in plugins)","typeGuard":"def has_plugins_array(doc: object) -> TypeGuard[dict]:\n    return isinstance(doc, dict) and isinstance(doc.get(\"plugins\"), list)","tryCatchPattern":"try:\n    mp = load_marketplace(root)\nexcept MarketplaceError as exc:\n    if \"must contain a plugins array\" in str(exc):\n        fix_manifest_plugins_key(root)\n    raise","preventionTips":["Use the canonical manifest template with `plugins` as a list.","Validate against a JSON Schema in CI before shipping manifests.","Watch library release notes for manifest schema changes."],"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"}