get_pools
Retrieve and list pools from Apache Airflow by specifying limits, offsets, and ordering. Streamlines pool management and integration with Airflow's REST API.
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 main asynchronous handler function for the 'get_pools' tool. It accepts optional pagination parameters (limit, offset, order_by), calls the Airflow PoolApi.get_pools, and returns the response as TextContent.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:14-20 (registration)The registration entry for 'get_pools' within the get_all_functions() list returned for pool API tools. This tuple (function, name, description, read_only) is used by main.py to register the tool with FastMCP.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:95-96 (registration)The tool registration loop in main.py that adds 'get_pools' (and other tools) to the FastMCP app using Tool.from_function, triggered when POOL API is selected.for func, name, description, *_ in functions: app.add_tool(Tool.from_function(func, name=name, description=description))
- src/main.py:16-16 (registration)Import of get_all_functions from pool.py, aliased as get_pool_functions, used to fetch the list containing 'get_pools' for registration.from src.airflow.pool import get_all_functions as get_pool_functions