patch_pool
Modify an existing Airflow pool by updating its slot count, description, or deferred task inclusion settings to optimize resource allocation.
Instructions
Update a pool
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | ||
| include_deferred | No | ||
| pool_name | Yes | ||
| slots | No |
Input Schema (JSON Schema)
{
"properties": {
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Description"
},
"include_deferred": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Include Deferred"
},
"pool_name": {
"title": "Pool Name",
"type": "string"
},
"slots": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Slots"
}
},
"required": [
"pool_name"
],
"type": "object"
}
Implementation Reference
- src/airflow/pool.py:117-147 (handler)The async handler function for the 'patch_pool' MCP tool. It constructs a Pool object from optional parameters (slots, description, include_deferred) and calls pool_api.patch_pool to update the Airflow pool, returning the response as TextContent.async def patch_pool( pool_name: str, slots: Optional[int] = None, description: Optional[str] = None, include_deferred: Optional[bool] = None, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """ Update a pool. Args: pool_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 updated pool details. """ pool = Pool() if slots is not None: pool.slots = slots if description is not None: pool.description = description if include_deferred is not None: pool.include_deferred = include_deferred response = pool_api.patch_pool(pool_name=pool_name, pool=pool) return [types.TextContent(type="text", text=str(response.to_dict()))]
- src/airflow/pool.py:12-20 (registration)The get_all_functions function registers the 'patch_pool' tool (along with others) by returning a tuple (patch_pool, 'patch_pool', 'Update a pool', False) for MCP tool registration.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), ]