## 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 |
|---|
| ```bash 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` | `string` Required. The name of the environment. Format: `projects/{projectId}/locations/{locationId}/environments/{environmentId}` |
| `dagId` | `string` Required. The Airflow DAG ID. |

## Output Schema

A Composer DAG resource.

### Dag

| JSON representation |
|---|
| ``` { "name": string, "dagId": string, "state": enum (`https://docs.cloud.google.com/composer/docs/reference/mcp/tools_list/get_dag#Output.Schema.State`), "description": string, "runningCount": integer, "lastRunEndTime": string, "fileloc": string, "startDate": string, "endDate": string, "catchup": enum (`https://docs.cloud.google.com/composer/docs/reference/mcp/tools_list/get_dag#Output.Schema.CatchupValue`), "maxActiveRuns": integer, "maxActiveTasks": integer, "dagrunTimeout": string, "lastUpdated": string, "failStop": boolean, "tags": [ string ], "docMd": string, // Union field `schedule` can be only one of the following: "cronSchedule": string, "durationSchedule": string // End of list of possible types for union field `schedule`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. The resource name of the DAG, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}/dags/{dagId}". |
| `dagId` | `string` Required. The DAG ID. |
| `state` | ``enum (`https://docs.cloud.google.com/composer/docs/reference/mcp/tools_list/get_dag#Output.Schema.State`)`` Output only. The current state of the DAG. |
| `description` | `string` The description of the DAG. |
| `runningCount` | `integer` The number of running instances of the DAG. |
| `lastRunEndTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` 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: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `fileloc` | `string` File location relative to the Cloud Storage bucket root folder. |
| `startDate` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` 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: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `endDate` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` 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: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `catchup` | ``enum (`https://docs.cloud.google.com/composer/docs/reference/mcp/tools_list/get_dag#Output.Schema.CatchupValue`)`` Whether the catchup is enabled for the DAG. |
| `maxActiveRuns` | `integer` Maximum number of simultaneous active runs of the DAG. Default is zero. |
| `maxActiveTasks` | `integer` Maximum number of simultaneous active tasks of the DAG. Default is zero. |
| `dagrunTimeout` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` Maximum runtime of a DAG run before termination with a timeout. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `lastUpdated` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` 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: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `failStop` | `boolean` Whether a "fail_stop" mode is enabled for the DAG. |
| `tags[]` | `string` The list of all tags associated with the DAG. |
| `docMd` | `string` 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` | `string` The DAG's schedule in cron format. |
| `durationSchedule` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` The DAG's schedule as a time duration between runs. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |

### Duration

| JSON representation |
|---|
| ``` { "seconds": string, "nanos": integer } ``` |

| Fields ||
|---|---|
| `seconds` | `string (https://developers.google.com/discovery/v1/type-format format)` 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` | `integer` Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 `seconds` field and a positive or negative `nanos` field. For durations of one second or more, a non-zero value for the `nanos` field must be of the same sign as the `seconds` field. Must be from -999,999,999 to +999,999,999 inclusive. |

### Timestamp

| JSON representation |
|---|
| ``` { "seconds": string, "nanos": integer } ``` |

| Fields ||
|---|---|
| `seconds` | `string (https://developers.google.com/discovery/v1/type-format format)` 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` | `integer` 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](https://modelcontextprotocol.io/specification/latest/schema#toolannotations) 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: ❌