post_pool
Creates and manages resource pools in Apache Airflow, specifying name, slots, and optional details to optimize task scheduling and resource allocation.
Instructions
Create a pool
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | ||
| include_deferred | No | ||
| name | Yes | ||
| slots | Yes |
Implementation Reference
- src/airflow/pool.py:84-114 (handler)The main handler function for the 'post_pool' tool, which creates a new Airflow pool using the PoolApi by constructing a Pool object from parameters and posting it.async def post_pool( name: str, slots: int, description: Optional[str] = None, include_deferred: Optional[bool] = None, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """ Create a pool. Args: name: The pool name. slots: The number of slots. description: The pool description. include_deferred: Whether to include deferred tasks in slot calculations. Returns: The created pool details. """ pool = Pool( name=name, slots=slots, ) if description is not None: pool.description = description if include_deferred is not None: pool.include_deferred = include_deferred response = pool_api.post_pool(pool=pool) return [types.TextContent(type="text", text=str(response.to_dict()))]
- src/airflow/pool.py:12-20 (registration)Registration of the 'post_pool' tool (and others) via the get_all_functions which returns tuples used by main.py to add tools to the MCP server.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), ]