get_user
Retrieve user details from Apache Airflow clusters using the v1 API. Specify a username to access specific user information for monitoring and management.
Instructions
[Tool Role]: Gets details of a specific user (v1 API only).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes |
Implementation Reference
- The get_user tool handler function, registered via @mcp.tool() decorator. It retrieves user details using the Airflow v1 API endpoint /users/{username}, with a check for v2 API incompatibility.@mcp.tool() async def get_user(username: str) -> Dict[str, Any]: """[Tool Role]: Gets details of a specific user (v1 API only).""" from ..functions import get_api_version api_version = get_api_version() if api_version == "v2": return {"error": "User management is not available in Airflow 3.x (API v2)", "available_in": "v1 only"} resp = await airflow_request("GET", f"/users/{username}") resp.raise_for_status() return resp.json()