# build_catalog_from_server_info

> **Function** in `deepagents_code`

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

Assemble a `ToolCatalog` from pre-collected built-in tools and live MCP info.

The interactive `/tools` command entry point: it avoids the `asyncio.run`
MCP discovery reached via `collect_catalog` (the `asyncio.run` call itself
lives in `collect_mcp_catalog`), which cannot run inside Textual's running
event loop, by reusing the MCP metadata the app already loaded. `mcp_error`
is always `None` here because discovery is not attempted — any load failures
are already reflected per-server in `server_info` as non-`ok` `MCPServerInfo`
entries, which `split_mcp_server_info` surfaces as `UnavailableServer`s.

## Signature

```python
build_catalog_from_server_info(
    built_in: Sequence[ToolEntry],
    server_info: Sequence[MCPServerInfo],
) -> ToolCatalog
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `built_in` | `Sequence[ToolEntry]` | Yes | Built-in tools in bind order (from `collect_built_in_tools`). |
| `server_info` | `Sequence[MCPServerInfo]` | Yes | The app's already-loaded MCP server metadata. |

## Returns

`ToolCatalog`

A `ToolCatalog` with the built-in group first, then any MCP groups, plus

---

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