## Tool: `query_compilation_actions`

Return the compilation result actions for a given Dataform compilation result.

The `name` parameter value must be in the format `projects/{project_id}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}`.

The following code sample shows how to use `curl` to call the `query_compilation_actions` MCP tool.

| Curl Request |
|---|
| ```bash curl --location 'https://dataform.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "query_compilation_actions", "arguments": { // Provide these details according to the MCP tool specification. } }, "jsonrpc": "2.0", "id": 1 }' ``` |

## Input Schema

`QueryCompilationResultActions` request message.

### QueryCompilationResultActionsRequest

| JSON representation |
|---|
| ``` { "name": string, "pageSize": integer, "pageToken": string, "filter": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. The compilation result's name. |
| `pageSize` | `integer` Optional. Maximum number of compilation results to return. The server may return fewer items than requested. If unspecified, the server will pick an appropriate default. |
| `pageToken` | `string` Optional. Page token received from a previous `QueryCompilationResultActions` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `QueryCompilationResultActions`, with the exception of `page_size`, must match the call that provided the page token. |
| `filter` | `string` Optional. Optional filter for the returned list. Filtering is only currently supported on the `file_path` field. |

## Output Schema

`QueryCompilationResultActions` response message.

### QueryCompilationResultActionsResponse

| JSON representation |
|---|
| ``` { "compilationResultActions": [ { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.CompilationResultAction`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `compilationResultActions[]` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.CompilationResultAction`)`` List of compilation result actions. |
| `nextPageToken` | `string` A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. |

### CompilationResultAction

| JSON representation |
|---|
| ``` { "target": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`) }, "canonicalTarget": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`) }, "filePath": string, // Union field `compiled_object` can be only one of the following: "relation": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.Relation`) }, "operations": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.Operations`) }, "assertion": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.Assertion`) }, "declaration": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.Declaration`) }, "notebook": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.Notebook`) }, "dataPreparation": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.DataPreparation`) } // End of list of possible types for union field `compiled_object`. // Union field `_internal_metadata` can be only one of the following: "internalMetadata": string // End of list of possible types for union field `_internal_metadata`. } ``` |

| Fields ||
|---|---|
| `target` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`)`` This action's identifier. Unique within the compilation result. |
| `canonicalTarget` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`)`` The action's identifier if the project had been compiled without any overrides configured. Unique within the compilation result. |
| `filePath` | `string` The full path including filename in which this action is located, relative to the workspace root. |
| Union field `compiled_object`. The compiled object. `compiled_object` can be only one of the following: ||
| `relation` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.Relation`)`` The database relation created/updated by this action. |
| `operations` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.Operations`)`` The database operations executed by this action. |
| `assertion` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.Assertion`)`` The assertion executed by this action. |
| `declaration` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.Declaration`)`` The declaration declared by this action. |
| `notebook` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.Notebook`)`` The notebook executed by this action. |
| `dataPreparation` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.DataPreparation`)`` The data preparation executed by this action. |
|   ||
| Union field `_internal_metadata`. `_internal_metadata` can be only one of the following: ||
| `internalMetadata` | `string` Output only. All the metadata information that is used internally to serve the resource. For example: timestamps, flags, status fields, etc. The format of this field is a JSON string. |
|   ||

### Relation

| JSON representation |
|---|
| ``` { "dependencyTargets": [ { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`) } ], "disabled": boolean, "tags": [ string ], "relationDescriptor": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.RelationDescriptor`) }, "relationType": enum (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.RelationType`), "selectQuery": string, "preOperations": [ string ], "postOperations": [ string ], "incrementalTableConfig": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.IncrementalTableConfig`) }, "partitionExpression": string, "clusterExpressions": [ string ], "partitionExpirationDays": integer, "requirePartitionFilter": boolean, "additionalOptions": { string: string, ... }, "connection": string, "tableFormat": enum (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.TableFormat`), "fileFormat": enum (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.FileFormat`), "storageUri": string } ``` |

| Fields ||
|---|---|
| `dependencyTargets[]` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`)`` A list of actions that this action depends on. |
| `disabled` | `boolean` Whether this action is disabled (i.e. should not be run). |
| `tags[]` | `string` Arbitrary, user-defined tags on this action. |
| `relationDescriptor` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.RelationDescriptor`)`` Descriptor for the relation and its columns. |
| `relationType` | ``enum (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.RelationType`)`` The type of this relation. |
| `selectQuery` | `string` The SELECT query which returns rows which this relation should contain. |
| `preOperations[]` | `string` SQL statements to be executed before creating the relation. |
| `postOperations[]` | `string` SQL statements to be executed after creating the relation. |
| `incrementalTableConfig` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.IncrementalTableConfig`)`` Configures `INCREMENTAL_TABLE` settings for this relation. Only set if `relation_type` is `INCREMENTAL_TABLE`. |
| `partitionExpression` | `string` The SQL expression used to partition the relation. |
| `clusterExpressions[]` | `string` A list of columns or SQL expressions used to cluster the table. |
| `partitionExpirationDays` | `integer` Sets the partition expiration in days. |
| `requirePartitionFilter` | `boolean` Specifies whether queries on this table must include a predicate filter that filters on the partitioning column. |
| `additionalOptions` | `map (key: string, value: string)` Additional options that will be provided as key/value pairs into the options clause of a create table/view statement. See <https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language> for more information on which options are supported. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `connection` | `string` Optional. The connection specifying the credentials to be used to read and write to external storage, such as Cloud Storage. The connection can have the form `{project}.{location}.{connection_id}` or `projects/{project}/locations/{location}/connections/{connection_id}`, or be set to DEFAULT. |
| `tableFormat` | ``enum (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.TableFormat`)`` Optional. The table format for the BigQuery table. |
| `fileFormat` | ``enum (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.FileFormat`)`` Optional. The file format for the BigQuery table. |
| `storageUri` | `string` Optional. The fully qualified location prefix of the external folder where table data is stored. The URI should be in the format `gs://bucket/path_to_table/`. |

### Target

| JSON representation |
|---|
| ``` { "database": string, "schema": string, "name": string } ``` |

| Fields ||
|---|---|
| `database` | `string` Optional. The action's database (Google Cloud project ID) . |
| `schema` | `string` Optional. The action's schema (BigQuery dataset ID), within `database`. |
| `name` | `string` Optional. The action's name, within `database` and `schema`. |

### RelationDescriptor

| JSON representation |
|---|
| ``` { "description": string, "columns": [ { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.ColumnDescriptor`) } ], "bigqueryLabels": { string: string, ... } } ``` |

| Fields ||
|---|---|
| `description` | `string` A text description of the relation. |
| `columns[]` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.ColumnDescriptor`)`` A list of descriptions of columns within the relation. |
| `bigqueryLabels` | `map (key: string, value: string)` A set of BigQuery labels that should be applied to the relation. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

### ColumnDescriptor

| JSON representation |
|---|
| ``` { "path": [ string ], "description": string, "bigqueryPolicyTags": [ string ] } ``` |

| Fields ||
|---|---|
| `path[]` | `string` The identifier for the column. Each entry in `path` represents one level of nesting. |
| `description` | `string` A textual description of the column. |
| `bigqueryPolicyTags[]` | `string` A list of BigQuery policy tags that will be applied to the column. |

### BigqueryLabelsEntry

| JSON representation |
|---|
| ``` { "key": string, "value": string } ``` |

| Fields ||
|---|---|
| `key` | `string` |
| `value` | `string` |

### IncrementalTableConfig

| JSON representation |
|---|
| ``` { "incrementalSelectQuery": string, "refreshDisabled": boolean, "uniqueKeyParts": [ string ], "updatePartitionFilter": string, "incrementalPreOperations": [ string ], "incrementalPostOperations": [ string ] } ``` |

| Fields ||
|---|---|
| `incrementalSelectQuery` | `string` The SELECT query which returns rows which should be inserted into the relation if it already exists and is not being refreshed. |
| `refreshDisabled` | `boolean` Whether this table should be protected from being refreshed. |
| `uniqueKeyParts[]` | `string` A set of columns or SQL expressions used to define row uniqueness. If any duplicates are discovered (as defined by `unique_key_parts`), only the newly selected rows (as defined by `incremental_select_query`) will be included in the relation. |
| `updatePartitionFilter` | `string` A SQL expression conditional used to limit the set of existing rows considered for a merge operation (see `unique_key_parts` for more information). |
| `incrementalPreOperations[]` | `string` SQL statements to be executed before inserting new rows into the relation. |
| `incrementalPostOperations[]` | `string` SQL statements to be executed after inserting new rows into the relation. |

### AdditionalOptionsEntry

| JSON representation |
|---|
| ``` { "key": string, "value": string } ``` |

| Fields ||
|---|---|
| `key` | `string` |
| `value` | `string` |

### Operations

| JSON representation |
|---|
| ``` { "dependencyTargets": [ { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`) } ], "disabled": boolean, "tags": [ string ], "relationDescriptor": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.RelationDescriptor`) }, "queries": [ string ], "hasOutput": boolean } ``` |

| Fields ||
|---|---|
| `dependencyTargets[]` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`)`` A list of actions that this action depends on. |
| `disabled` | `boolean` Whether this action is disabled (i.e. should not be run). |
| `tags[]` | `string` Arbitrary, user-defined tags on this action. |
| `relationDescriptor` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.RelationDescriptor`)`` Descriptor for any output relation and its columns. Only set if `has_output` is true. |
| `queries[]` | `string` A list of arbitrary SQL statements that will be executed without alteration. |
| `hasOutput` | `boolean` Whether these operations produce an output relation. |

### Assertion

| JSON representation |
|---|
| ``` { "dependencyTargets": [ { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`) } ], "parentAction": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`) }, "disabled": boolean, "tags": [ string ], "selectQuery": string, "relationDescriptor": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.RelationDescriptor`) } } ``` |

| Fields ||
|---|---|
| `dependencyTargets[]` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`)`` A list of actions that this action depends on. |
| `parentAction` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`)`` The parent action of this assertion. Only set if this assertion was automatically generated. |
| `disabled` | `boolean` Whether this action is disabled (i.e. should not be run). |
| `tags[]` | `string` Arbitrary, user-defined tags on this action. |
| `selectQuery` | `string` The SELECT query which must return zero rows in order for this assertion to succeed. |
| `relationDescriptor` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.RelationDescriptor`)`` Descriptor for the assertion's automatically-generated view and its columns. |

### Declaration

| JSON representation |
|---|
| ``` { "relationDescriptor": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.RelationDescriptor`) } } ``` |

| Fields ||
|---|---|
| `relationDescriptor` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.RelationDescriptor`)`` Descriptor for the relation and its columns. Used as documentation only, i.e. values here will result in no changes to the relation's metadata. |

### Notebook

| JSON representation |
|---|
| ``` { "dependencyTargets": [ { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`) } ], "disabled": boolean, "contents": string, "tags": [ string ] } ``` |

| Fields ||
|---|---|
| `dependencyTargets[]` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`)`` A list of actions that this action depends on. |
| `disabled` | `boolean` Whether this action is disabled (i.e. should not be run). |
| `contents` | `string` The contents of the notebook. |
| `tags[]` | `string` Arbitrary, user-defined tags on this action. |

### DataPreparation

| JSON representation |
|---|
| ``` { "dependencyTargets": [ { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`) } ], "disabled": boolean, "tags": [ string ], // Union field `definition` can be only one of the following: "contentsYaml": string, "contentsSql": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.SqlDefinition`) } // End of list of possible types for union field `definition`. } ``` |

| Fields ||
|---|---|
| `dependencyTargets[]` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`)`` A list of actions that this action depends on. |
| `disabled` | `boolean` Whether this action is disabled (i.e. should not be run). |
| `tags[]` | `string` Arbitrary, user-defined tags on this action. |
| Union field `definition`. The definition for the data preparation. `definition` can be only one of the following: ||
| `contentsYaml` | `string` The data preparation definition, stored as a YAML string. |
| `contentsSql` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.SqlDefinition`)`` SQL definition for a Data Preparation. Contains a SQL query and additional context information. |
|   ||

### SqlDefinition

| JSON representation |
|---|
| ``` { "query": string, "errorTable": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.ErrorTable`) }, "load": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.LoadConfig`) } } ``` |

| Fields ||
|---|---|
| `query` | `string` The SQL query representing the data preparation steps. Formatted as a Pipe SQL query statement. |
| `errorTable` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.ErrorTable`)`` Error table configuration, |
| `load` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.LoadConfig`)`` Load configuration. |

### ErrorTable

| JSON representation |
|---|
| ``` { "target": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`) }, "retentionDays": integer } ``` |

| Fields ||
|---|---|
| `target` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/list_workflow_configs#Output.Schema.Target`)`` Error Table target. |
| `retentionDays` | `integer` Error table partition expiration in days. Only positive values are allowed. |

### LoadConfig

| JSON representation |
|---|
| ``` { // Union field `mode` can be only one of the following: "replace": { object (`SimpleLoadMode`) }, "append": { object (`SimpleLoadMode`) }, "maximum": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.IncrementalLoadMode`) }, "unique": { object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.IncrementalLoadMode`) } // End of list of possible types for union field `mode`. } ``` |

| Fields ||
|---|---|
| Union field `mode`. Load mode `mode` can be only one of the following: ||
| `replace` | ``object (`SimpleLoadMode`)`` Replace destination table |
| `append` | ``object (`SimpleLoadMode`)`` Append into destination table |
| `maximum` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.IncrementalLoadMode`)`` Insert records where the value exceeds the previous maximum value for a column in the destination table |
| `unique` | ``object (`https://docs.cloud.google.com/dataform/docs/reference/mcp/tools_list/query_compilation_actions#Output.Schema.IncrementalLoadMode`)`` Insert records where the value of a column is not already present in the destination table |
|   ||

### IncrementalLoadMode

| JSON representation |
|---|
| ``` { "column": string } ``` |

| Fields ||
|---|---|
| `column` | `string` Column name for incremental load modes |

### RelationType

Indicates the type of this relation.

| Enums ||
|---|---|
| `RELATION_TYPE_UNSPECIFIED` | Default value. This value is unused. |
| `TABLE` | The relation is a table. |
| `VIEW` | The relation is a view. |
| `INCREMENTAL_TABLE` | The relation is an incrementalized table. |
| `MATERIALIZED_VIEW` | The relation is a materialized view. |

### TableFormat

Supported table formats for BigQuery tables.

| Enums ||
|---|---|
| `TABLE_FORMAT_UNSPECIFIED` | Default value. |
| `ICEBERG` | Apache Iceberg format. |

### FileFormat

Supported file formats for BigQuery tables.

| Enums ||
|---|---|
| `FILE_FORMAT_UNSPECIFIED` | Default value. |
| `PARQUET` | Apache Parquet format. |

### 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: ❌