# is_legacy_hooks_document

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/hooks/migration/is_legacy_hooks_document)

Return whether `data` looks like the legacy list-shaped hooks document.

## Signature

```python
is_legacy_hooks_document(
    data: object,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `data` | `object` | Yes | Parsed JSON root. |

## Returns

`bool`

`True` when `hooks` is a list of command entries rather than an event map.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/hooks/migration.py#L177)