MCP Tools Reference: datamigration

Tool: set_entity_ai_ddl

Sets the AI-generated DDL for a single entity 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_workspace parameter is in the form 'projects/{project name}/locations/{location}/conversionWorkspaces/{conversion_workspace_name}', for example: 'projects/my-project/locations/us-central1/conversionWorkspaces/cs1'.

The following code sample shows how to use curl to call the set_entity_ai_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_entity_ai_ddl",
    "arguments": {
      // Provide these details according to the MCP tool specification.
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'

Input Schema

Request message for 'SetEntityAiDdl' request.

SetEntityAiDdlRequest

JSON representation
{
  "conversionWorkspace": string,
  "entityFullName": string,
  "entityType": enum (DatabaseEntityType),
  "ddl": string,
  "explanation": string
}
Fields
conversionWorkspace

string

Required. Name of the conversion workspace resource in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.

entityFullName

string

Required. The draft entity full name.

entityType

enum (DatabaseEntityType)

Required. The type of the database entity.

ddl

string

Required. The DDL to set.

explanation

string

Optional. The explanation of the DDL.

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.

Output Schema

Response message for 'SetEntityAiDdl' 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: ❌