MCP Tools Reference: cloud-sql

Tool: list_instances

List all Cloud SQL instances in the project.

The following sample demonstrate how to use curl to invoke the list_instances 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": "list_instances",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

Input Schema

Instance list request.

SqlInstancesListRequest

JSON representation
{
  "filter": string,
  "maxResults": integer,
  "pageToken": string,
  "project": string
}
Fields
filter

string

A filter expression that filters resources listed in the response. The expression is in the form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON representation, such as 'settings.userLabels.auto_start:true'.

Multiple filter queries are space-separated. For example. 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly.

maxResults

integer (uint32 format)

The maximum number of instances to return. The service may return fewer than this value. If unspecified, at most 500 instances are returned. The maximum value is 1000; values above 1000 are coerced to 1000.

pageToken

string

A previously-returned page token representing part of the larger set of results to view.

project

string

Project ID of the project for which to list Cloud SQL instances.

Output Schema

Instance list response for MCP.

SqlInstancesListMcpResponse

JSON representation
{
  "kind": string,
  "warnings": [
    {
      object (ApiWarning)
    }
  ],
  "items": [
    {
      object (McpDatabaseInstance)
    }
  ],
  "nextPageToken": string
}
Fields
kind

string

This is always sql#instancesList.

warnings[]

object (ApiWarning)

List of warnings that occurred while handling the request.

items[]

object (McpDatabaseInstance)

List of mcp instance resources.

nextPageToken

string

The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.

ApiWarning

JSON representation
{
  "code": enum (SqlApiWarningCode),
  "message": string,
  "region": string
}
Fields
code

enum (SqlApiWarningCode)

Code to uniquely identify the warning type.

message

string

The warning message.

region

string

The region name for REGION_UNREACHABLE warning.

McpDatabaseInstance

JSON representation
{
  "project": string,
  "name": string,
  "databaseVersion": string,
  "region": string,
  "edition": string,
  "tier": string,
  "dataDiskSizeGb": string,
  "availabilityType": string,
  "tags": {
    string: string,
    ...
  },
  "state": enum (SqlInstanceState)
}
Fields
project

string

Required. Project ID of the project for which to list Cloud SQL instances.

name

string

Required. Name of the Cloud SQL instance. This does not include the project ID.

databaseVersion

string

region

string

Optional. The geographical region of the Cloud SQL instance. For example, us-central1, europe-west1, and asia-east1.

edition

string

Optional. The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS.

tier

string

Optional. The tier (or machine type) for this instance.

dataDiskSizeGb

string (Int64Value format)

Optional. Data disk size in GB. Default value is 100.

availabilityType

string

Optional. Availability type. Potential values: * ZONAL: The instance serves data from only one zone. Outages in that zone affect data accessibility. This is the default value. * REGIONAL: The instance can serve data from more than one zone in a region (it is highly available).

tags

map (key: string, value: string)

Optional. Input only. Tag keys and tag values that are bound to this instance.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

state

enum (SqlInstanceState)

Output only. State of the Cloud SQL instance.

Int64Value

JSON representation
{
  "value": string
}
Fields
value

string (int64 format)

The int64 value.

TagsEntry

JSON representation
{
  "key": string,
  "value": string
}
Fields
key

string

value

string

Tool Annotations

Destructive Hint: ❌ | Idempotent Hint: ❌ | Read Only Hint: ✅ | Open World Hint: ❌