---
title: filterable
sidebarTitle: filterable
---

# `pdsx.mcp.filterable`


filterable decorator for MCP tools.

Adds a `_filter` parameter that accepts jmespath expressions to
filter/project tool results. Reduces response size and lets
LLM clients request only the fields they need.

See https://jmespath.org for filter syntax.


## Functions

### `apply_filter` <sup><a href="https://github.com/zzstoatzz/pdsx/blob/main/src/pdsx/mcp/filterable.py#L35" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
apply_filter(data: Any, filter_expr: str | None) -> Any
```


apply jmespath filter to data.


### `filterable` <sup><a href="https://github.com/zzstoatzz/pdsx/blob/main/src/pdsx/mcp/filterable.py#L58" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
filterable(fn: Callable[P, R] | Callable[P, Awaitable[R]]) -> Callable[P, Any] | Callable[P, Awaitable[Any]]
```


decorator that adds `_filter` parameter to a tool.

the filter is a jmespath expression applied to the result.
see https://jmespath.org/ for syntax.

