Skip to main content
Glama

MCP-Airflow-API

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
AIRFLOW_API_URLYesThe base URL of your Airflow REST API endpoint
MCP_SERVER_PORTNoControls the transport mode selection. When NOT set: Uses stdio transport (traditional MCP mode). When set: Uses http transport (Docker mode)
AIRFLOW_LOG_LEVELNoControls logging verbosity. Values: DEBUG, INFO, WARNING, ERRORINFO
AIRFLOW_API_PASSWORDYesPassword for Airflow API authentication
AIRFLOW_API_USERNAMEYesUsername for Airflow API authentication

Schema

Prompts

Interactive templates invoked by user choice

NameDescription
prompt_template_fullReturn the full canonical prompt template.
prompt_template_headingsReturn compact list of section headings.
prompt_template_sectionReturn a specific prompt template section by number or keyword.

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
get_prompt_template

Returns the MCP prompt template (full, headings, or specific section). Args: section: Section number or keyword (optional) mode: 'full', 'headings', or None (optional)

list_dags

[Tool Role]: Lists all DAGs registered in the Airflow cluster with pagination support.

Args: limit: Maximum number of DAGs to return (default: 20) - For small queries: use default 100 - For large environments: use 500-1000 to get more DAGs at once - Maximum recommended: 1000 (to avoid API timeouts) offset: Number of DAGs to skip for pagination (default: 0) - Use 0 for first page - Use limit*page_number for subsequent pages - Example: offset=100 for page 2 when limit=100

Pagination Examples: - First 20 DAGs: list_dags() - Next 20 DAGs: list_dags(limit=20, offset=20)
- Page 3 of 50 DAGs each: list_dags(limit=50, offset=100) - All DAGs at once: list_dags(limit=1000)

Use total_entries from response to determine if more pages exist: - has_more_pages = (offset + limit) < total_entries - next_offset = offset + limit - remaining_count = total_entries - (offset + limit)

Returns: Dict containing: - dags: List of DAG objects with comprehensive info (dag_id, dag_display_name, is_active, is_paused, description, schedule_interval, max_active_runs, max_active_tasks, owners, tags, next_dagrun info, last_parsed_time, has_import_errors, timetable_description) - total_entries: Total number of DAGs in Airflow (for pagination calculation) - limit: Requested limit (echoed back) - offset: Requested offset (echoed back) - returned_count: Actual number of DAGs returned in this response - has_more_pages: Boolean indicating if more pages are available - next_offset: Suggested offset for next page (if has_more_pages is True)

get_dag

[Tool Role]: Retrieves detailed information for a specific DAG.

Args: dag_id: The DAG ID to get details for

Returns: Comprehensive DAG details: dag_id, schedule_interval, start_date, owners, tags, description, etc.

get_dags_detailed_batch

[Tool Role]: Retrieves detailed information for multiple DAGs in batch with get_dag() level detail plus latest run information.

This tool combines list_dags() filtering with get_dag() detailed information retrieval, providing comprehensive DAG details AND latest execution information for multiple DAGs in a single response. Each DAG entry includes both static configuration details and dynamic runtime information.

Args: limit: Maximum number of DAGs to process (default: 100) - Use higher values (500-1000) for large environments - Ignored when fetch_all=True offset: Number of DAGs to skip for pagination (default: 0) fetch_all: If True, fetches all DAGs regardless of limit/offset (default: False) id_contains: Filter DAGs by ID containing this string (optional) name_contains: Filter DAGs by display name containing this string (optional) is_active: Filter by active status - True/False (optional) is_paused: Filter by paused status - True/False (optional)

Usage Examples: - All unpaused DAGs with full details and latest runs: get_dags_detailed_batch(fetch_all=True, is_paused=False) - Active, unpaused DAGs only: get_dags_detailed_batch(is_active=True, is_paused=False) - DAGs containing "example": get_dags_detailed_batch(id_contains="example", limit=50) - Paginated batch: get_dags_detailed_batch(limit=100, offset=200)

Returns: Dictionary containing: - dags_detailed: List of detailed DAG objects with: * All get_dag() fields (dag_id, schedule_interval, start_date, owners, tags, etc.) * latest_dag_run: Most recent execution information (run_id, state, start_date, end_date, etc.) - total_processed: Number of DAGs successfully processed - total_available: Total number of DAGs matching initial filters - processing_stats: Success/failure counts and error details - applied_filters: Summary of filters applied - pagination_info: Current page info and remaining counts

running_dags

[Tool Role]: Lists all currently running DAG runs in the Airflow cluster.

Returns: List of running DAG runs with comprehensive info: dag_id, run_id, state, execution_date, start_date, end_date, data_interval_start, data_interval_end, run_type, conf, external_trigger, dag_display_name

failed_dags

[Tool Role]: Lists all recently failed DAG runs in the Airflow cluster.

Returns: List of failed DAG runs with comprehensive info: dag_id, run_id, state, execution_date, start_date, end_date, data_interval_start, data_interval_end, run_type, conf, external_trigger, dag_display_name

trigger_dag

[Tool Role]: Triggers a new DAG run for a specified Airflow DAG.

Args: dag_id: The DAG ID to trigger

Returns: Minimal info about triggered DAG run: dag_id, run_id, state, execution_date, start_date, end_date

pause_dag

[Tool Role]: Pauses the specified Airflow DAG (prevents scheduling new runs).

Args: dag_id: The DAG ID to pause

Returns: Minimal info about the paused DAG: dag_id, is_paused

unpause_dag

[Tool Role]: Unpauses the specified Airflow DAG (allows scheduling new runs).

Args: dag_id: The DAG ID to unpause

Returns: Minimal info about the unpaused DAG: dag_id, is_paused

dag_graph

[Tool Role]: Retrieves the task dependency graph structure for a specific DAG.

Args: dag_id: The DAG ID to get graph structure for

Returns: DAG graph with tasks and dependencies: dag_id, tasks, dependencies

list_tasks

[Tool Role]: Lists all tasks for a specific DAG.

Args: dag_id: The DAG ID to get tasks for

Returns: List of tasks with detailed task information: dag_id, tasks, total_tasks

dag_code

[Tool Role]: Retrieves the source code for a specific DAG.

Args: dag_id: The DAG ID to get source code for

Returns: DAG source code: dag_id, file_token, source_code

list_event_logs

[Tool Role]: Lists event log entries with optional filtering.

Args: dag_id: Filter by DAG ID (optional) task_id: Filter by task ID (optional) run_id: Filter by run ID (optional) limit: Maximum number of log entries to return (default: 20, increased from 20 for better coverage) offset: Number of entries to skip (default: 0)

Returns: List of event logs: event_logs, total_entries, limit, offset, pagination metadata

get_event_log

[Tool Role]: Retrieves a specific event log entry by ID.

Args: event_log_id: The event log ID to retrieve

Returns: Single event log entry: event_log_id, when, event, dag_id, task_id, run_id, etc.

all_dag_event_summary

[Tool Role]: Retrieves event count summary for all DAGs.

Returns: Summary of event counts by DAG: dag_summaries, total_dags, total_events

list_import_errors

[Tool Role]: Lists import errors with optional filtering.

Args: limit: Maximum number of import errors to return (default: 20, increased from 20 for better coverage) offset: Number of entries to skip (default: 0)

Returns: List of import errors: import_errors, total_entries, limit, offset, pagination metadata

get_import_error

[Tool Role]: Retrieves a specific import error by ID.

Args: import_error_id: The import error ID to retrieve

Returns: Single import error: import_error_id, filename, stacktrace, timestamp

all_dag_import_summary

[Tool Role]: Retrieves import error summary for all DAGs.

Returns: Summary of import errors by filename: import_summaries, total_errors, affected_files

dag_run_duration

[Tool Role]: Retrieves run duration statistics for a specific DAG.

Args: dag_id: The DAG ID to get run durations for limit: Maximum number of recent runs to analyze (default: 50, increased from 10 for better statistics)

Returns: DAG run duration data: dag_id, runs, statistics

dag_task_duration

[Tool Role]: Retrieves task duration information for a specific DAG run.

Args: dag_id: The DAG ID to get task durations for run_id: Specific run ID (if not provided, uses latest run)

Returns: Task duration data: dag_id, run_id, tasks, statistics

dag_calendar

[Tool Role]: Retrieves calendar/schedule information for a specific DAG.

Args: dag_id: The DAG ID to get calendar info for start_date: Start date for calendar range (YYYY-MM-DD format, optional) end_date: End date for calendar range (YYYY-MM-DD format, optional) limit: Maximum number of DAG runs to return (default: 20, was hardcoded at 50)

Returns: DAG calendar data: dag_id, schedule_interval, runs, next_runs

get_health

[Tool Role]: Get the health status of the Airflow webserver instance.

Returns: Health status information including metadatabase and scheduler status

get_version

[Tool Role]: Get version information of the Airflow instance.

Returns: Version information including Airflow version, Git version, and build info

list_pools

[Tool Role]: List all pools in the Airflow instance.

Args: limit: Maximum number of pools to return (default: 20) offset: Number of pools to skip for pagination (default: 0)

Returns: List of pools with their configuration and usage information

get_pool

[Tool Role]: Get detailed information about a specific pool.

Args: pool_name: The name of the pool to retrieve

Returns: Detailed pool information including slots usage and description

list_task_instances_all

[Tool Role]: Lists task instances across all DAGs or filtered by specific DAG with comprehensive filtering options.

IMPORTANT: When users provide natural language dates, calculate relative dates using the current server time context (internally via get_current_time_context):

  • "yesterday" = current_date - 1 day
  • "last week" = current_date - 7 days to current_date - 1 day
  • "last 3 days" = current_date - 3 days to current_date
  • "today" = current_date

Args: dag_id: Filter by DAG ID (optional) dag_run_id: Filter by DAG run ID (optional) execution_date_gte: Filter by execution date greater than or equal to (ISO 8601 format with timezone, e.g., '2024-01-01T00:00:00Z', optional) execution_date_lte: Filter by execution date less than or equal to (ISO 8601 format with timezone, e.g., '2024-01-01T23:59:59Z', optional) start_date_gte: Filter by start date greater than or equal to (ISO 8601 format with timezone, optional) start_date_lte: Filter by start date less than or equal to (ISO 8601 format with timezone, optional) end_date_gte: Filter by end date greater than or equal to (ISO 8601 format with timezone, optional) end_date_lte: Filter by end date less than or equal to (ISO 8601 format with timezone, optional) duration_gte: Filter by duration greater than or equal to (seconds, optional) duration_lte: Filter by duration less than or equal to (seconds, optional) state: Filter by task state (queued, running, success, failed, up_for_retry, up_for_reschedule, upstream_failed, skipped, deferred, scheduled, removed, restarting, optional) pool: Filter by pool name (optional) queue: Filter by queue name (optional) limit: Maximum number of task instances to return (default: 20) offset: Number of task instances to skip for pagination (default: 0)

Returns: List of task instances with comprehensive information: task_instances, total_entries, limit, offset

get_task_instance_details

[Tool Role]: Retrieves detailed information about a specific task instance.

Args: dag_id: The DAG ID containing the task dag_run_id: The DAG run ID containing the task instance task_id: The task ID to retrieve details for

Returns: Detailed task instance information including execution details, state, timing, and configuration

list_task_instances_batch

[Tool Role]: Lists task instances in batch with multiple filtering criteria for bulk operations.

Relative date filters (if provided) are resolved against the server's current time.

Args: dag_ids: List of DAG IDs to filter by (optional) dag_run_ids: List of DAG run IDs to filter by (optional) task_ids: List of task IDs to filter by (optional) execution_date_gte: Filter by execution date greater than or equal to (ISO format, optional) execution_date_lte: Filter by execution date less than or equal to (ISO format, optional) start_date_gte: Filter by start date greater than or equal to (ISO format, optional) start_date_lte: Filter by start date less than or equal to (ISO format, optional) end_date_gte: Filter by end date greater than or equal to (ISO format, optional) end_date_lte: Filter by end date less than or equal to (ISO format, optional) duration_gte: Filter by duration greater than or equal to (seconds, optional) duration_lte: Filter by duration less than or equal to (seconds, optional) state: List of task states to filter by (optional) pool: List of pool names to filter by (optional) queue: List of queue names to filter by (optional)

Returns: Batch list of task instances with filtering results: task_instances, total_entries, applied_filters

get_task_instance_extra_links

[Tool Role]: Lists extra links for a specific task instance (e.g., monitoring dashboards, logs, external resources).

Args: dag_id: The DAG ID containing the task dag_run_id: The DAG run ID containing the task instance task_id: The task ID to get extra links for

Returns: List of extra links with their URLs and descriptions: task_id, dag_id, dag_run_id, extra_links

get_task_instance_logs

[Tool Role]: Retrieves logs for a specific task instance and its try number with content and metadata.

Args: dag_id: The DAG ID containing the task dag_run_id: The DAG run ID containing the task instance task_id: The task ID to get logs for try_number: The try number for the task instance (default: 1) full_content: Whether to return full log content or just metadata (default: False) token: Pagination token for large logs (optional)

Returns: Task instance logs with content and metadata: task_id, dag_id, dag_run_id, try_number, content, metadata

list_variables

[Tool Role]: Lists all variables stored in Airflow.

Args: limit: Maximum number of variables to return (default: 20) offset: Number of variables to skip for pagination (default: 0) order_by: Order variables by field (key, description) (default: key)

Returns: List of variables with their keys, values, and descriptions

get_variable

[Tool Role]: Retrieves a specific variable by its key from Airflow.

Args: variable_key: The key of the variable to retrieve

Returns: Variable information including key, value, and description

list_xcom_entries

[Tool Role]: Lists XCom entries for a specific task instance.

Args: dag_id: The DAG ID dag_run_id: The DAG run ID
task_id: The task ID limit: Maximum number of entries to return (default: 20) offset: Number of entries to skip (default: 0)

Returns: Dictionary containing XCom entries with key, value, timestamp, and other metadata

get_xcom_entry

[Tool Role]: Retrieves a specific XCom entry for a task instance.

Args: dag_id: The DAG ID dag_run_id: The DAG run ID task_id: The task ID
xcom_key: The XCom key to retrieve map_index: Map index for mapped tasks (default: -1 for non-mapped)

Returns: Dictionary containing the specific XCom entry with full value and metadata

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