Skip to main content
Glama

list_permissions

Retrieve all available permissions in Apache Airflow to configure access controls and manage user roles effectively.

Instructions

[Tool Role]: Lists all permissions available in the Airflow system (v1 API only).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function implementing the list_permissions tool. It checks the API version and calls the Airflow REST API /permissions endpoint if v1, otherwise returns an error message for v2. Registered via @mcp.tool() decorator.
    @mcp.tool()
    async def list_permissions() -> Dict[str, Any]:
        """[Tool Role]: Lists all permissions available in the Airflow system (v1 API only)."""
        from ..functions import get_api_version
        
        api_version = get_api_version()
        if api_version == "v2":
            return {"error": "Permission management is not available in Airflow 3.x (API v2)", "available_in": "v1 only"}
        
        resp = await airflow_request("GET", "/permissions")
        resp.raise_for_status()
        return resp.json()
  • Registration of common tools (including list_permissions) for v1 API by calling common_tools.register_common_tools(mcp).
    def register_tools(mcp):
        """Register v1 tools by importing common tools with v1 request function."""
        
        logger.info("Initializing MCP server for Airflow API v1")
        logger.info("Loading Airflow API v1 tools (Airflow 2.x)")
        
        # Set the global request function to v1
        common_tools.airflow_request = airflow_request_v1
        
        # Register all 56 common tools (includes management tools)
        common_tools.register_common_tools(mcp)
        
        # V1 has no exclusive tools - all tools are shared with v2
        
        logger.info("Registered all Airflow API v1 tools (56 tools: 43 core + 13 management tools)")
  • Registration of common tools (including list_permissions) for v2 API by calling common_tools.register_common_tools(mcp).
    def register_tools(mcp):
        """Register v2 tools: common tools + v2-exclusive asset tools."""
        
        logger.info("Initializing MCP server for Airflow API v2")
        logger.info("Loading Airflow API v2 tools (Airflow 3.0+)")
        
        # Set the global request function to v2
        common_tools.airflow_request = airflow_request_v2
        
        # Register all 43 common tools
        common_tools.register_common_tools(mcp)
        
        # Add V2-exclusive tools (2 tools)
        @mcp.tool()
        async def list_assets(limit: int = 20, offset: int = 0,
                             uri_pattern: Optional[str] = None) -> Dict[str, Any]:
            """
            [V2 New] List all assets in the system for data-aware scheduling.
            
            Assets are a key feature in Airflow 3.0 for data-aware scheduling.
            They enable workflows to be triggered by data changes rather than time schedules.
            
            Args:
                limit: Maximum number of assets to return (default: 20)
                offset: Number of assets to skip for pagination (default: 0)
                uri_pattern: Filter assets by URI pattern (optional)
                
            Returns:
                Dict containing assets list, pagination info, and metadata
            """
            params = {'limit': limit, 'offset': offset}
            if uri_pattern:
                params['uri_pattern'] = uri_pattern
                
            query_string = "&".join([f"{k}={v}" for k, v in params.items()])
            
            resp = await airflow_request_v2("GET", f"/assets?{query_string}")
            resp.raise_for_status()
            data = resp.json()
            
            return {
                "assets": data.get("assets", []),
                "total_entries": data.get("total_entries", 0),
                "limit": limit,
                "offset": offset,
                "api_version": "v2",
                "feature": "assets"
            }
    
        @mcp.tool()
        async def list_asset_events(limit: int = 20, offset: int = 0,
                                   asset_uri: Optional[str] = None,
                                   source_dag_id: Optional[str] = None) -> Dict[str, Any]:
            """
            [V2 New] List asset events for data lineage tracking.
            
            Asset events track when assets are created or updated by DAGs.
            This enables data lineage tracking and data-aware scheduling in Airflow 3.0.
            
            Args:
                limit: Maximum number of events to return (default: 20)
                offset: Number of events to skip for pagination (default: 0)
                asset_uri: Filter events by specific asset URI (optional)
                source_dag_id: Filter events by source DAG that produced the event (optional)
                
            Returns:
                Dict containing asset events list, pagination info, and metadata
            """
            params = {'limit': limit, 'offset': offset}
            if asset_uri:
                params['asset_uri'] = asset_uri
            if source_dag_id:
                params['source_dag_id'] = source_dag_id
                
            query_string = "&".join([f"{k}={v}" for k, v in params.items()])
            
            resp = await airflow_request_v2("GET", f"/assets/events?{query_string}")
            resp.raise_for_status()
            data = resp.json()
            
            return {
                "asset_events": data.get("asset_events", []),
                "total_entries": data.get("total_entries", 0),
                "limit": limit,
                "offset": offset,
                "api_version": "v2",
                "feature": "asset_events"
            }
    
        logger.info("Registered all Airflow API v2 tools (43 common + 2 assets + 4 management = 49 tools)")
  • Helper function used by list_permissions to determine Airflow API version.
    def get_api_version():
        """Get API version from environment."""
        return os.getenv("AIRFLOW_API_VERSION", "v1").lower()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Lists all permissions') but doesn't describe behavioral traits such as pagination, rate limits, authentication needs, or what the output includes. The mention of 'v1 API only' adds some context about API version constraints, but overall, key behavioral details are missing for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Lists all permissions') and adds necessary context ('in the Airflow system (v1 API only)'). There is zero waste, and every part of the sentence earns its place by clarifying scope and constraints.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 0 parameters, 100% schema coverage, and an output schema exists, the description is minimally complete. It states what the tool does and adds API version context. However, with no annotations and behavioral traits undisclosed, it lacks details on output format, error handling, or usage nuances, making it adequate but with clear gaps for a list operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add parameter-specific information, which is appropriate here. A baseline score of 4 is given as it adequately handles the lack of parameters without introducing confusion.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Lists') and resource ('all permissions available in the Airflow system'), making the purpose specific and understandable. It distinguishes from siblings by specifying 'permissions' as the resource, which is unique among the sibling tools. However, it doesn't explicitly differentiate from similar list operations like list_roles or list_users, though those target different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'v1 API only', which hints at a version constraint but doesn't explain when to choose this over other permission-related tools or list operations. No exclusions, prerequisites, or sibling comparisons are provided, leaving usage context vague.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/call518/MCP-Airflow-API'

If you have feedback or need assistance with the MCP directory API, please join our Discord server