Tool: set_draft_entity_ddl
Sets the DDL for a single entity as either AI generated or user edited, and marks it as the DDL to apply. If this is the first time the AI DDL is set for this entity, the server also adds a review recommendation warning issue and any applicable issues from the deterministic conversion. The entity_full_name parameter should be the full name of the draft entity, for example: 'person.ids'. The entity_type parameter should be the type of the draft entity, for example: 'DATABASE_ENTITY_TYPE_STORED_PROCEDURE', 'DATABASE_ENTITY_TYPE_TABLE', etc.
conversion_workspaceparameter is in the form 'projects/{project name}/locations/{location}/conversionWorkspaces/{conversion_workspace_name}', for example: 'projects/my-project/locations/us-central1/conversionWorkspaces/cs1'.ddl_kindparameter specifies the kind of DDL, either 'AI' or 'USER_EDIT'.
The following code sample shows how to use curl to call the set_draft_entity_ddl MCP tool.
| Curl Request |
|---|
curl --location 'https://datamigration.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "set_draft_entity_ddl", "arguments": { // Provide these details according to the MCP tool specification. } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request message for 'SetEntityDraftDdl' request.
SetEntityDraftDdlRequest
| JSON representation |
|---|
{ "conversionWorkspace": string, "entityFullName": string, "entityType": enum ( |
| Fields | |
|---|---|
conversionWorkspace |
Required. Name of the conversion workspace resource in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. |
entityFullName |
Required. The draft entity full name. |
entityType |
Required. The type of the database entity. |
ddl |
Required. The DDL to set. |
explanation |
Optional. The explanation of the DDL. |
ddlKind |
Required. The DDL kind to set. |
DatabaseEntityType
The type of database entities supported,
| Enums | |
|---|---|
DATABASE_ENTITY_TYPE_UNSPECIFIED |
Unspecified database entity type. |
DATABASE_ENTITY_TYPE_SCHEMA |
Schema. |
DATABASE_ENTITY_TYPE_TABLE |
Table. |
DATABASE_ENTITY_TYPE_COLUMN |
Column. |
DATABASE_ENTITY_TYPE_CONSTRAINT |
Constraint. |
DATABASE_ENTITY_TYPE_INDEX |
Index. |
DATABASE_ENTITY_TYPE_TRIGGER |
Trigger. |
DATABASE_ENTITY_TYPE_VIEW |
View. |
DATABASE_ENTITY_TYPE_SEQUENCE |
Sequence. |
DATABASE_ENTITY_TYPE_STORED_PROCEDURE |
Stored Procedure. |
DATABASE_ENTITY_TYPE_FUNCTION |
Function. |
DATABASE_ENTITY_TYPE_SYNONYM |
Synonym. |
DATABASE_ENTITY_TYPE_DATABASE_PACKAGE |
Package. |
DATABASE_ENTITY_TYPE_UDT |
UDT. |
DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW |
Materialized View. |
DATABASE_ENTITY_TYPE_DATABASE |
Database. |
DraftDdlKind
The kind of the DDL.
| Enums | |
|---|---|
DRAFT_DDL_KIND_UNSPECIFIED |
The DDL kind is unspecified. |
AI |
The DDL is generated by AI. |
USER_EDIT |
The DDL is edited by user. |
Output Schema
Response message for 'SetEntityDraftDdl' request.
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: ❌