Tool: create_instance
Initiates the creation of a Cloud SQL instance.
- The tool returns a long-running operation. Use the
get_operationtool to poll its status until the operation completes. - The instance creation operation can take several minutes. Use a command line tool to pause for 30 seconds before rechecking the status.
- After you use the
create_instancetool to create an instance, you can use thecreate_usertool to create an IAM user account for the user currently logged in to the project. -
The value of
data_api_accessis set toALLOW_DATA_APIby default. This setting lets you execute SQL statements using theexecute_sqltool and theexecuteSqlAPI.
Unless otherwise specified, a newly created instance uses the default instance configuration of a development environment.
The following is the default configuration for an instance in a development environment:
{
"tier": "db-perf-optimized-N-2",
"data_disk_size_gb": 100,
"region": "us-central1",
"database_version": "POSTGRES_18",
"edition": "ENTERPRISE_PLUS",
"availability_type": "ZONAL",
"tags": [{"environment": "dev"}]
}
The following configuration is recommended for an instance in a production environment:
{
"tier": "db-perf-optimized-N-8",
"data_disk_size_gb": 250,
"region": "us-central1",
"database_version": "POSTGRES_18",
"edition": "ENTERPRISE_PLUS",
"availability_type": "REGIONAL",
"tags": [{"environment": "prod"}]
}
The following instance configuration is recommended for SQL Server:
{
"tier": "db-perf-optimized-N-8",
"data_disk_size_gb": 250,
"region": "us-central1",
"database_version": "SQLSERVER_2022_STANDARD",
"edition": "ENTERPRISE_PLUS",
"availability_type": "REGIONAL",
"tags": [{"environment": "prod"}]
}
The following sample demonstrate how to use curl
to invoke the create_instance
MCP tool.
| Curl Request |
|---|
curl --location 'https://sqladmin.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "create_instance", "arguments": { // provide these details according to the tool' s MCP specification } } , "jsonrpc" : "2.0" , "id" : 1 } ' |
Input Schema
Instance insert request for MCP.
SqlInstancesInsertMcpRequest
| JSON representation |
|---|
{ "project" : string , "name" : string , "databaseVersion" : string , "region" : string , "edition" : string , "tier" : string , "dataDiskSizeGb" : string , "availabilityType" : string , "tags" : { string : string , ... } , "dataCacheEnabled" : boolean , "enableGoogleMlIntegration" : boolean } |
| Fields | |
|---|---|
project
|
Required. Project ID of the project to which the newly created Cloud SQL instances should belong. |
name
|
Required. Name of the Cloud SQL instance. This does not include the project ID. |
databaseVersion
|
Optional. The database engine type and version. The default value is For Mysql, it can be |
region
|
Optional. The geographical region of the Cloud SQL instance. For example, If not specified, the default value is |
edition
|
Optional. The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS. If not specified: - For Postgres and Mysql, the default value is ENTERPRISE_PLUS. - For SQL Server, the default value is ENTERPRISE. |
tier
|
Optional. The tier (or machine type) for this instance. If not specified: - For ENTERPRISE_PLUS edition needs to use N2 machine series. ENTERPRISE edition can use custom machine type names use the following format: db-custom-{CPUs}-{Memory}. |
dataDiskSizeGb
|
Optional. Data disk size in GB. Default value is 100. |
availabilityType
|
Optional. Availability type. Potential values: * |
tags
|
Optional. Input only. Tag keys and tag values that are bound to this instance. You must represent each item in the map as: For example, a single resource can have the following tags:
An object containing a list of |
dataCacheEnabled
|
Optional. Whether data cache is enabled for the instance. |
enableGoogleMlIntegration
|
Optional. When this parameter is set to true, Cloud SQL instances can connect to Vertex AI to pass requests for real-time predictions and insights to the AI. The default value is false. This applies only to Cloud SQL for MySQL and Cloud SQL for PostgreSQL instances. |
Int64Value
| JSON representation |
|---|
{ "value" : string } |
| Fields | |
|---|---|
value
|
The int64 value. |
TagsEntry
| JSON representation |
|---|
{ "key" : string , "value" : string } |
| Fields | |
|---|---|
key
|
|
value
|
|
BoolValue
| JSON representation |
|---|
{ "value" : boolean } |
| Fields | |
|---|---|
value
|
The bool value. |
Output Schema
An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
Operation
| JSON representation |
|---|
{ "kind" : string , "targetLink" : string , "status" : enum ( |
| Fields | |
|---|---|
kind
|
This is always |
targetLink
|
|
status
|
The status of an operation. |
user
|
The email address of the user who initiated this operation. |
insertTime
|
The time this operation was enqueued in UTC timezone in RFC 3339
format, for example Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
startTime
|
The time this operation actually started in UTC timezone in RFC 3339
format, for example Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
endTime
|
The time this operation finished in UTC timezone in RFC 3339
format, for example Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
error
|
If errors occurred during processing of this operation, this field will be populated. |
apiWarning
|
An Admin API warning message. |
operationType
|
The type of the operation. Valid values are: * |
importContext
|
The context for import operation, if applicable. |
exportContext
|
The context for export operation, if applicable. |
backupContext
|
The context for backup operation, if applicable. |
preCheckMajorVersionUpgradeContext
|
This field is only populated when the operation_type is PRE_CHECK_MAJOR_VERSION_UPGRADE. The PreCheckMajorVersionUpgradeContext message itself contains the details for that pre-check, such as the target database version for the upgrade and the results of the check (including any warnings or errors found). |
name
|
An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
targetId
|
Name of the resource on which this operation runs. |
selfLink
|
The URI of this resource. |
targetProject
|
The project ID of the target instance related to this operation. |
acquireSsrsLeaseContext
|
The context for acquire SSRS lease operation, if applicable. |
subOperationType
|
Optional. The sub operation based on the operation type. |
Timestamp
| JSON representation |
|---|
{ "seconds" : string , "nanos" : integer } |
| Fields | |
|---|---|
seconds
|
Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be between -62135596800 and 253402300799 inclusive (which corresponds to 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). |
nanos
|
Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive. |
OperationErrors
| JSON representation |
|---|
{
"kind"
:
string
,
"errors"
:
[
{
object (
|
| Fields | |
|---|---|
kind
|
This is always |
errors[]
|
The list of errors encountered while processing this operation. |
OperationError
| JSON representation |
|---|
{ "kind" : string , "code" : string , "message" : string } |
| Fields | |
|---|---|
kind
|
This is always |
code
|
Identifies the specific error that occurred. |
message
|
Additional information about the error encountered. |
ApiWarning
| JSON representation |
|---|
{
"code"
:
enum (
|
| Fields | |
|---|---|
code
|
Code to uniquely identify the warning type. |
message
|
The warning message. |
region
|
The region name for REGION_UNREACHABLE warning. |
ImportContext
| JSON representation |
|---|
{ "uri" : string , "database" : string , "kind" : string , "fileType" : enum ( |
| Fields | |
|---|---|
uri
|
Path to the import file in Cloud Storage, in the form |
database
|
The target database for the import. If |
kind
|
This is always |
fileType
|
The file type for the specified uri.`SQL |
csvImportOptions
|
Options for importing data as CSV. |
importUser
|
The PostgreSQL user for this import operation. PostgreSQL instances only. |
bakImportOptions
|
Import parameters specific to SQL Server .BAK files |
sqlImportOptions
|
Optional. Options for importing data from SQL statements. |
tdeImportOptions
|
Optional. Import parameters specific to SQL Server TDE certificates |
SqlCsvImportOptions
| JSON representation |
|---|
{ "table" : string , "columns" : [ string ] , "escapeCharacter" : string , "quoteCharacter" : string , "fieldsTerminatedBy" : string , "linesTerminatedBy" : string } |
| Fields | |
|---|---|
table
|
The table to which CSV data is imported. |
columns[]
|
The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
escapeCharacter
|
Specifies the character that should appear before a data character that needs to be escaped. |
quoteCharacter
|
Specifies the quoting character to be used when a data value is quoted. |
fieldsTerminatedBy
|
Specifies the character that separates columns within each row (line) of the file. |
linesTerminatedBy
|
This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values. |
SqlBakImportOptions
| JSON representation |
|---|
{ "encryptionOptions" : { object ( |
| Fields | |
|---|---|
encryptionOptions
|
|
striped
|
Whether or not the backup set being restored is striped. Applies only to Cloud SQL for SQL Server. |
noRecovery
|
Whether or not the backup importing will restore database with NORECOVERY option. Applies only to Cloud SQL for SQL Server. |
recoveryOnly
|
Whether or not the backup importing request will just bring database online without downloading Bak content only one of "no_recovery" and "recovery_only" can be true otherwise error will return. Applies only to Cloud SQL for SQL Server. |
bakType
|
Type of the bak content, FULL or DIFF |
stopAt
|
Optional. The timestamp when the import should stop. This timestamp is in the RFC 3339
format (for example, Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
stopAtMark
|
Optional. The marked transaction where the import should stop. This field is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL Server only. |
EncryptionOptions
| JSON representation |
|---|
{ "certPath" : string , "pvkPath" : string , "pvkPassword" : string , "keepEncrypted" : boolean } |
| Fields | |
|---|---|
certPath
|
Path to the Certificate (.cer) in Cloud Storage, in the form |
pvkPath
|
Path to the Certificate Private Key (.pvk) in Cloud Storage, in the form |
pvkPassword
|
Password that encrypts the private key |
keepEncrypted
|
Optional. Whether the imported file remains encrypted. |
BoolValue
| JSON representation |
|---|
{ "value" : boolean } |
| Fields | |
|---|---|
value
|
The bool value. |
SqlImportOptions
| JSON representation |
|---|
{
"threads"
:
integer
,
"parallel"
:
boolean
,
"postgresImportOptions"
:
{
object (
|
| Fields | |
|---|---|
threads
|
Optional. The number of threads to use for parallel import. |
parallel
|
Optional. Whether or not the import should be parallel. |
postgresImportOptions
|
Optional. Options for importing from a Cloud SQL for PostgreSQL instance. |
Int32Value
| JSON representation |
|---|
{ "value" : integer } |
| Fields | |
|---|---|
value
|
The int32 value. |
PostgresImportOptions
| JSON representation |
|---|
{ "clean" : boolean , "ifExists" : boolean } |
| Fields | |
|---|---|
clean
|
Optional. The --clean flag for the pg_restore utility. This flag applies only if you enabled Cloud SQL to import files in parallel. |
ifExists
|
Optional. The --if-exists flag for the pg_restore utility. This flag applies only if you enabled Cloud SQL to import files in parallel. |
SqlTdeImportOptions
| JSON representation |
|---|
{ "certificatePath" : string , "privateKeyPath" : string , "privateKeyPassword" : string , "name" : string } |
| Fields | |
|---|---|
certificatePath
|
Required. Path to the TDE certificate public key in the form gs://bucketName/fileName. The instance must have read access to the file. Applicable only for SQL Server instances. |
privateKeyPath
|
Required. Path to the TDE certificate private key in the form gs://bucketName/fileName. The instance must have read access to the file. Applicable only for SQL Server instances. |
privateKeyPassword
|
Required. Password that encrypts the private key. |
name
|
Required. Certificate name. Applicable only for SQL Server instances. |
ExportContext
| JSON representation |
|---|
{ "uri" : string , "databases" : [ string ] , "kind" : string , "sqlExportOptions" : { object ( |
| Fields | |
|---|---|
uri
|
The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form |
databases[]
|
Databases to be exported. |
kind
|
This is always |
sqlExportOptions
|
Options for exporting data as SQL statements. |
csvExportOptions
|
Options for exporting data as CSV. |
fileType
|
The file type for the specified uri. |
offload
|
Whether to perform a serverless export. |
bakExportOptions
|
Options for exporting data as BAK files. |
tdeExportOptions
|
Optional. Export parameters specific to SQL Server TDE certificates |
SqlExportOptions
| JSON representation |
|---|
{ "tables" : [ string ] , "schemaOnly" : boolean , "mysqlExportOptions" : { object ( |
| Fields | |
|---|---|
tables[]
|
Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
schemaOnly
|
Export only schemas. |
mysqlExportOptions
|
|
threads
|
Optional. The number of threads to use for parallel export. |
parallel
|
Optional. Whether or not the export should be parallel. |
postgresExportOptions
|
Optional. Options for exporting from a Cloud SQL for PostgreSQL instance. |
MysqlExportOptions
| JSON representation |
|---|
{ "masterData" : integer } |
| Fields | |
|---|---|
masterData
|
Option to include SQL statement required to set up replication. If set to |
PostgresExportOptions
| JSON representation |
|---|
{ "clean" : boolean , "ifExists" : boolean } |
| Fields | |
|---|---|
clean
|
Optional. Use this option to include DROP SQL statements. Use these statements to delete database objects before running the import operation. |
ifExists
|
Optional. Option to include an IF EXISTS SQL statement with each DROP statement produced by clean. |
SqlCsvExportOptions
| JSON representation |
|---|
{ "selectQuery" : string , "escapeCharacter" : string , "quoteCharacter" : string , "fieldsTerminatedBy" : string , "linesTerminatedBy" : string } |
| Fields | |
|---|---|
selectQuery
|
The select query used to extract the data. |
escapeCharacter
|
Specifies the character that should appear before a data character that needs to be escaped. |
quoteCharacter
|
Specifies the quoting character to be used when a data value is quoted. |
fieldsTerminatedBy
|
Specifies the character that separates columns within each row (line) of the file. |
linesTerminatedBy
|
This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values. |
SqlBakExportOptions
| JSON representation |
|---|
{
"striped"
:
boolean
,
"stripeCount"
:
integer
,
"bakType"
:
enum (
|
| Fields | |
|---|---|
striped
|
Whether or not the export should be striped. |
stripeCount
|
Option for specifying how many stripes to use for the export. If blank, and the value of the striped field is true, the number of stripes is automatically chosen. |
bakType
|
Type of this bak file will be export, FULL or DIFF, SQL Server only |
copyOnly
|
Deprecated: copy_only is deprecated. Use differential_base instead |
differentialBase
|
Whether or not the backup can be used as a differential base copy_only backup can not be served as differential base |
exportLogStartTime
|
Optional. The begin timestamp when transaction log will be included in the export operation. RFC 3339
format (for example, Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
exportLogEndTime
|
Optional. The end timestamp when transaction log will be included in the export operation. RFC 3339
format (for example, Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
SqlTdeExportOptions
| JSON representation |
|---|
{ "certificatePath" : string , "privateKeyPath" : string , "privateKeyPassword" : string , "name" : string } |
| Fields | |
|---|---|
certificatePath
|
Required. Path to the TDE certificate public key in the form gs://bucketName/fileName. The instance must have write access to the bucket. Applicable only for SQL Server instances. |
privateKeyPath
|
Required. Path to the TDE certificate private key in the form gs://bucketName/fileName. The instance must have write access to the location. Applicable only for SQL Server instances. |
privateKeyPassword
|
Required. Password that encrypts the private key. |
name
|
Required. Certificate name. Applicable only for SQL Server instances. |
BackupContext
| JSON representation |
|---|
{ "backupId" : string , "kind" : string , "name" : string } |
| Fields | |
|---|---|
backupId
|
The identifier of the backup. |
kind
|
This is always |
name
|
The name of the backup. Format: projects/{project}/backups/{backup} |
PreCheckMajorVersionUpgradeContext
| JSON representation |
|---|
{ "targetDatabaseVersion" : enum ( |
| Fields | |
|---|---|
targetDatabaseVersion
|
Required. The target database version to upgrade to. |
preCheckResponse[]
|
Output only. The responses from the precheck operation. |
kind
|
Optional. This is always |
PreCheckResponse
| JSON representation |
|---|
{ "actionsRequired" : [ string ] , // Union field |
actionsRequired[]
string
The actions that the user needs to take. Use repeated for multiple actions.
Union field _message
.
_message
can be only one of the following:
message
string
The message to be displayed to the user.
Union field _message_type
.
_message_type
can be only one of the following:
messageType
enum (
MessageType
)
The type of message whether it is an info, warning, or error.
AcquireSsrsLeaseContext
| JSON representation |
|---|
{ // Union field |
Union field _setup_login
.
_setup_login
can be only one of the following:
setupLogin
string
The username to be used as the setup login to connect to the database server for SSRS setup.
Union field _service_login
.
_service_login
can be only one of the following:
serviceLogin
string
The username to be used as the service login to connect to the report database for SSRS setup.
Union field _report_database
.
_report_database
can be only one of the following:
reportDatabase
string
The report database to be used for SSRS setup.
Union field _duration
.
_duration
can be only one of the following:
duration
string (
Duration
format)
Lease duration needed for SSRS setup.
A duration in seconds with up to nine fractional digits, ending with ' s
'. Example: "3.5s"
.
Duration
| JSON representation |
|---|
{ "seconds" : string , "nanos" : integer } |
| Fields | |
|---|---|
seconds
|
Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
nanos
|
Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 |
SqlSubOperationType
| JSON representation |
|---|
{ // Union field |
sub_operation_details
. Sub operation details corresponding to the operation type. sub_operation_details
can be only one of the following:maintenanceType
enum (
SqlMaintenanceType
)
The type of maintenance to be performed on the instance.
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ❌ | Read Only Hint: ❌ | Open World Hint: ❌

