MCP Tools Reference: datamigration

Tool: list_entities_and_dependencies

Gets the entities and their dependency information of a conversion workspace. The dependency information shows for each entity on which other entities it directly depends on. Note that the dependency on the schema is not included, for example, table 'Person.IDs' depends on schema 'Persons' but the schema is not listed as a dependency. All entities, including those without dependencies are included in the response.

  • If no 'next_page_token' is returned, there are no more entities to retrieve.
  • name parameter is in the form 'projects/{project name}/locations/{location}/conversionWorkspaces/{conversion_workspace_name}', for example: 'projects/my-project/locations/us-central1/conversionWorkspaces/cs1'.
  • schemas parameter is an optional list of schemas to be included in the response, for example: ['Person', 'HR']. An empty list means all schemas are selected.
  • entities_full_names parameter is an optional list of entities to be included in the response, for example: ['Person.IDs', 'Persons.Salaries', 'HR.Employees']. An empty list means all entities are included.
  • draft_entities determines whether the dependencies are for the draft or source entities.
  • The page_size parameter specifies the maximum number of entities to return in the response. Default is 1000. The value must be between 1 and 1000.
  • The page_token parameter should be filled with the value of next_page_token from the previous response. If not specified, the first page is returned.

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

Input Schema

Request message for 'ListEntitiesDependencies' request.

ListEntitiesDependenciesRequest

JSON representation
{
  "name": string,
  "draftEntities": boolean,
  "schemas": [
    string
  ],
  "entitiesFullNames": [
    string
  ],
  "pageSize": integer,
  "pageToken": string
}
Fields
name

string

Required. The resource name for the conversion workspace. Must be in the format projects/{project_name}/locations/{location}/conversionWorkspaces/{conversion_workspace_name}. For example: 'projects/my-project/locations/us-central1/conversionWorkspaces/cs1'

draftEntities

boolean

Required. Whether to get the dependency graph for the source entities or the destination (draft) entities.

schemas[]

string

Optional. An optional list of schemas to filter the dependency graph to. If empty, all schemas will be included.

entitiesFullNames[]

string

Optional. An optional list of entities to filter the dependency graph to. If empty, all entities will be included.

pageSize

integer

Optional. The maximum number of entities to return. The service may return fewer entities than the value specifies. Default is 1000.

pageToken

string

Optional. The nextPageToken value received in the previous call to ListEntitiesDependencies, used in the subsequent request to retrieve the next page of results. On first call this should be left blank. When paginating, all other parameters provided must match the call that provided the page token, except for the page_size parameter.

Output Schema

Response message for 'ListEntitiesDependencies' request.

ListEntitiesDependenciesResponse

JSON representation
{
  "entities": [
    {
      object (EntityDependency)
    }
  ],
  "nextPageToken": string
}
Fields
entities[]

object (EntityDependency)

Output only. The dependency information of the entities matching the request filter.

nextPageToken

string

Output only. A token which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

EntityDependency

JSON representation
{
  "sourceEntityId": {
    object (EntityId)
  },
  "draftEntityId": {
    object (EntityId)
  },
  "dependencies": [
    {
      object (EntityId)
    }
  ]
}
Fields
sourceEntityId

object (EntityId)

The source entity id.

draftEntityId

object (EntityId)

The draft entity id.

dependencies[]

object (EntityId)

The direct dependencies of the entity.

EntityId

JSON representation
{
  "shortName": string,
  "type": enum (DatabaseEntityType),
  "parentName": string,
  "parentType": enum (DatabaseEntityType)
}
Fields
shortName

string

The short name (e.g. table name) of the entity.

type

enum (DatabaseEntityType)

The type of the database entity (schema, table, view, index, ...).

parentName

string

The parent entity full name.

parentType

enum (DatabaseEntityType)

The type of the database entity (schema, table, view, ...).

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.

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