# collect_tools_from_agent

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/tool_catalog/collect_tools_from_agent)

Read tools from a local compiled agent when its graph is inspectable.

LangGraph does not expose a public tool-enumeration API, so this reaches
through the compiled graph's conventional `nodes["tools"].bound` shape.
Returning `None` distinguishes an uninspectable graph (a remote agent, or a
local graph whose internals no longer match that convention) from a local
graph that validly binds zero tools (`[]`).

## Signature

```python
collect_tools_from_agent(
    agent: object,
) -> list[ToolEntry] | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `agent` | `object` | Yes | Active local or remote agent object. |

## Returns

`list[ToolEntry] | None`

Bound tools in graph order; `[]` for an inspectable local graph with no

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e4c1ffe9ee63d7854147de490ca27495ef157a7b/libs/code/deepagents_code/tool_catalog.py#L287)