# libtmux_mcp.middleware.ToolsetMiddleware

- **Module:** libtmux_mcp.middleware
- **Package:** libtmux-mcp
- **Language:** Python
- **Kind:** class
- **Source:** https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/middleware.py#L89
- **Bases:** `Middleware`
- **Page:** https://libtmux.org/en/py/stable/mcp/reference/libtmux_mcp-middleware-toolsetmiddleware/

Filter tools to the enabled toolsets.

Filtering controls which MCP tool calls this server advertises and
accepts. It does not confine tmux: an enabled ``execute`` tool can type
the equivalent of any hidden tool.

## Members

### Other members

- [`on_call_tool`](/en/py/stable/mcp/reference/libtmux_mcp-middleware-toolsetmiddleware-on_call_tool/) (method): Refuse a tool outside the enabled surface.
- [`on_list_tools`](/en/py/stable/mcp/reference/libtmux_mcp-middleware-toolsetmiddleware-on_list_tools/) (method): Drop tools outside the enabled surface from the listing.
- [`__init__`](/en/py/stable/mcp/reference/libtmux_mcp-middleware-toolsetmiddleware-__init__/) (method)
