Tool: translate_metadata
Translates a metadata .ZIP file into Data Definition Language (DDL) statements and table mappings that are written to target_base_uri. The metadata file is generated by the BigQuery Migration Service metadata extractor and should be uploaded to Cloud Storage. 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 |
|---|
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 } |
| Fields | |
|---|---|
projectNumber |
Required. The Google Cloud project number. |
location |
Required. The location. |
sourceDialect |
Required. The dialect of the source metadata. |
targetDialect |
Required. The dialect of the target queries. |
metadataFileUri |
Required. The Cloud Storage path of the metadata zip file for this batch translation. This must be a valid Cloud Storage URI starting with |
targetBaseUri |
Required. The base URI for all writes to persistent storage in Cloud Storage. The generated DDL will be written to this URI. |
Output Schema
Response message for TranslateMetadata.
TranslateMetadataResponse
| JSON representation |
|---|
{ "state": string, "translation": string } |
| Fields | |
|---|---|
state |
The state of the batch translation workflow. |
translation |
The ID of the batch translation workflow. |
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: ✅