Tool: get_dag
Retrieves metadata and status of a specific DAG in a Managed Airflow environment.
Use this tool when you need to check if a DAG exists, inspect its metadata (such as schedule or current state), or verify whether a newly uploaded/updated DAG file has been imported by Airflow (see list_import_errors tool description for more details). In particular, if a DAG was recently uploaded but get_dag returns NOT_FOUND, use list_import_errors to check if any errors occurred during the import.
The following code sample shows how to use curl to call the get_dag MCP tool.
| Curl Request |
|---|
curl --location 'https://composer.{region}.rep.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "get_dag", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Parameters of the get_dag tool.
GetDagRequestMCP
| JSON representation |
|---|
{ "environment": string, "dagId": string } |
| Fields | |
|---|---|
environment |
Required. The name of the environment. Format: |
dagId |
Required. The Airflow DAG ID. |
Output Schema
A Composer DAG resource.
Dag
| JSON representation |
|---|
{ "name": string, "dagId": string, "state": enum ( |
| Fields | |
|---|---|
name |
Required. The resource name of the DAG, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}/dags/{dagId}". |
dagId |
Required. The DAG ID. |
state |
Output only. The current state of the DAG. |
description |
The description of the DAG. |
runningCount |
The number of running instances of the DAG. |
lastRunEndTime |
The end timestamp of the last completed DAG run. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
fileloc |
File location relative to the Cloud Storage bucket root folder. |
startDate |
The start_date parameter of the DAG. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
endDate |
The end_date parameter of the DAG (if set). Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
catchup |
Whether the catchup is enabled for the DAG. |
maxActiveRuns |
Maximum number of simultaneous active runs of the DAG. Default is zero. |
maxActiveTasks |
Maximum number of simultaneous active tasks of the DAG. Default is zero. |
dagrunTimeout |
Maximum runtime of a DAG run before termination with a timeout. A duration in seconds with up to nine fractional digits, ending with ' |
lastUpdated |
The last time the DAG has been serialized. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
failStop |
Whether a "fail_stop" mode is enabled for the DAG. |
tags[] |
The list of all tags associated with the DAG. |
docMd |
Describes the DAG in Markdown format. |
Union field schedule. The schedule interval at which the DAG is run. schedule can be only one of the following: |
|
cronSchedule |
The DAG's schedule in cron format. |
durationSchedule |
The DAG's schedule as a time duration between runs. A duration in seconds with up to nine fractional digits, ending with ' |
Duration
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
nanos |
Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 |
Timestamp
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be between -62135596800 and 253402300799 inclusive (which corresponds to 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). |
nanos |
Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive. |
State
State of the DAG.
| Enums | |
|---|---|
STATE_UNSPECIFIED |
The state of the DAG is unknown. |
ACTIVE |
The DAG is available for execution. |
PAUSED |
The DAG is paused. |
CatchupValue
Catchup value of the DAG.
| Enums | |
|---|---|
CATCHUP_VALUE_UNSPECIFIED |
The state of the Cachup is unknown. |
ENABLED |
The catchup is enabled. |
DISABLED |
The catchup is disabled. |
Tool Annotations
Tool annotations are sent to MCP clients to describe the basic risk of a given tool. Most clients treat these hints as untrusted, but they can be used to decide when a confirmation prompt might be sent to a user.
Along with the title string, the following boolean hints are defined as follows:
readOnlyHint: If true, the tool doesn't modify its environment. Default: false.destructiveHint: If true, then the tool can perform destructive actions. If false, then the tool can only perform additive actions. Default: true.idempotentHint: If true, then calling the tool repeatedly with the same arguments will have no additional effect on its environment. Default: false.openWorldHint: If true, then the tool can interact with an 'open world' of external entities. If false, then the tool can only interact with internal entities. For example, a web search tool would be open world, while a memory tool would not be open world.
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌