get_pools
Retrieve and list available pools from Apache Airflow deployments to manage task execution resources and monitor capacity.
Instructions
List pools
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No | ||
| order_by | No |
Implementation Reference
- src/airflow/pool.py:23-50 (handler)The handler function implementing the 'get_pools' tool. It accepts optional parameters for pagination and sorting, calls the Airflow PoolApi.get_pools, and returns the response as text content.async def get_pools( limit: Optional[int] = None, offset: Optional[int] = None, order_by: Optional[str] = None, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """ List pools. Args: limit: The numbers of items to return. offset: The number of items to skip before starting to collect the result set. order_by: The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. Returns: A list of pools. """ # Build parameters dictionary kwargs: Dict[str, Any] = {} if limit is not None: kwargs["limit"] = limit if offset is not None: kwargs["offset"] = offset if order_by is not None: kwargs["order_by"] = order_by response = pool_api.get_pools(**kwargs) return [types.TextContent(type="text", text=str(response.to_dict()))]
- src/airflow/pool.py:12-20 (registration)The get_all_functions() that provides the registration tuple for 'get_pools' tool, used by the main server to register it.def get_all_functions() -> list[tuple[Callable, str, str, bool]]: """Return list of (function, name, description, is_read_only) tuples for registration.""" return [ (get_pools, "get_pools", "List pools", True), (get_pool, "get_pool", "Get a pool by name", True), (delete_pool, "delete_pool", "Delete a pool", False), (post_pool, "post_pool", "Create a pool", False), (patch_pool, "patch_pool", "Update a pool", False), ]
- src/main.py:90-92 (registration)The generic registration loop in main.py that adds the 'get_pools' tool (imported via get_pool_functions) to the MCP app using app.add_tool.for func, name, description, *_ in functions: app.add_tool(func, name=name, description=description)
- src/main.py:15-15 (registration)Import of pool module's get_all_functions in main.py, enabling registration of get_pools tool.from src.airflow.pool import get_all_functions as get_pool_functions