get_config
Retrieve current configuration settings from Apache Airflow, enabling efficient system management and customization by specifying optional sections.
Instructions
Get current configuration
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| section | No |
Implementation Reference
- src/airflow/config.py:19-29 (handler)The handler function for the 'get_config' tool. It accepts an optional 'section' parameter, calls the Airflow ConfigApi.get_config, and returns the response as MCP TextContent.async def get_config( section: Optional[str] = None, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: # Build parameters dictionary kwargs: Dict[str, Any] = {} if section is not None: kwargs["section"] = section response = config_api.get_config(**kwargs) return [types.TextContent(type="text", text=str(response.to_dict()))]
- src/airflow/config.py:11-16 (registration)The get_all_functions utility that registers the 'get_config' tool by providing its (function, name, description, read_only) tuple.def get_all_functions() -> list[tuple[Callable, str, str, bool]]: """Return list of (function, name, description, is_read_only) tuples for registration.""" return [ (get_config, "get_config", "Get current configuration", True), (get_value, "get_value", "Get a specific option from configuration", True), ]
- src/main.py:24-26 (registration)Mapping of APIType.CONFIG to the get_config_functions for dynamic tool registration in main().APITYPE_TO_FUNCTIONS = { APIType.CONFIG: get_config_functions, APIType.CONNECTION: get_connection_functions,
- src/main.py:95-97 (registration)The loop that adds tools to the MCP app using the functions from get_all_functions(), including 'get_config'.for func, name, description, *_ in functions: app.add_tool(Tool.from_function(func, name=name, description=description))