## Tool: `translate_metadata`

Translates a metadata .ZIP file into Data Definition Language (DDL) statements and table mapping files that are written to the `metadata/` folder under `target_base_uri`. The metadata file is generated by the BigQuery Migration Service metadata extractor and should be uploaded to Cloud Storage. You can also pass optional YAML configuration files in `configuration_file_paths` to customize object name mapping, type overrides, and partitioning or clustering alongside the metadata `.zip`. The translation runs asynchronously. Use the `fetch_batch_translation` tool with the returned translation ID to poll its state until it is `SUCCEEDED` or `FAILED`. Wait at least 10 seconds before rechecking the state. If it fails, read the logs returned by `fetch_batch_translation` to diagnose the issue. After it succeeds, read the results from `target_base_uri`.

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

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

## Input Schema

Request message for TranslateMetadata.

### TranslateMetadataRequest

| JSON representation |
|---|
| ``` { "projectNumber": string, "location": string, "sourceDialect": string, "targetDialect": string, "metadataFileUri": string, "targetBaseUri": string, "configurationFilePaths": [ string ] } ``` |

| Fields ||
|---|---|
| `projectNumber` | `string` Required. The Google Cloud project number. |
| `location` | `string` Required. The location. |
| `sourceDialect` | `string` Required. The dialect of the source metadata. |
| `targetDialect` | `string` Required. The dialect of the target queries. |
| `metadataFileUri` | `string` Required. The Cloud Storage path of the metadata zip file for this batch translation. This must be a valid Cloud Storage URI starting with `gs://` and must be a zip file ending with ".zip". |
| `targetBaseUri` | `string` Required. The base URI for all writes to persistent storage in Cloud Storage. The generated DDL and table mapping files will be written to the `metadata/` folder under this URI. |
| `configurationFilePaths[]` | `string` Optional. The Cloud Storage paths of YAML configuration files to apply during metadata translation (for example, to customize object name mappings, type conversions, partitioning, or clustering). Each path must be a valid Cloud Storage URI starting with `gs://` and ending with `.config.yaml`. For more information, see [YAML configuration guidelines](https://docs.cloud.google.com/bigquery/docs/config-yaml-translation.md.txt#yaml_guidelines). |

## Output Schema

Response message for TranslateMetadata.

### TranslateMetadataResponse

| JSON representation |
|---|
| ``` { "state": string, "translation": string } ``` |

| Fields ||
|---|---|
| `state` | `string` The state of the batch translation workflow. |
| `translation` | `string` The ID of the batch translation workflow. |

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