Tool: list_instances
List all Cloud SQL instances in the project.
The following code sample shows how to use curl to call 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 MCP tool specification. } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Instance list request.
SqlInstancesListRequest
| JSON representation |
|---|
{ "filter": string, "maxResults": integer, "pageToken": string, "project": string, "location": string } |
| Fields | |
|---|---|
filter |
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 |
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 |
A previously-returned page token representing part of the larger set of results to view. |
project |
Project ID of the project for which to list Cloud SQL instances. |
location |
Optional. Region of the Cloud SQL instance. |
Output Schema
Instance list response for MCP.
SqlInstancesListMcpResponse
| JSON representation |
|---|
{ "kind": string, "warnings": [ { object ( |
| Fields | |
|---|---|
kind |
This is always sql#instancesList. |
warnings[] |
List of warnings that occurred while handling the request. |
items[] |
List of mcp instance resources. |
nextPageToken |
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 ( |
| Fields | |
|---|---|
code |
Code to uniquely identify the warning type. |
message |
The warning message. |
region |
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 ( |
| Fields | |
|---|---|
project |
Required. Project ID of the project for which to list Cloud SQL instances. |
name |
Required. Name of the Cloud SQL instance. This does not include the project ID. |
databaseVersion |
|
region |
Optional. The geographical region of the Cloud SQL instance. For example, |
edition |
Optional. The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS. |
tier |
Optional. The tier (or machine type) for this instance. |
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. An object containing a list of |
state |
Output only. State of the Cloud SQL instance. |
Int64Value
| JSON representation |
|---|
{ "value": string } |
| Fields | |
|---|---|
value |
The int64 value. |
TagsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
SqlApiWarningCode
| Enums | |
|---|---|
SQL_API_WARNING_CODE_UNSPECIFIED |
An unknown or unset warning type from Cloud SQL API. |
REGION_UNREACHABLE |
Warning when one or more regions are not reachable. The returned result set may be incomplete. |
MAX_RESULTS_EXCEEDS_LIMIT |
Warning when user provided maxResults parameter exceeds the limit. The returned result set may be incomplete. |
COMPROMISED_CREDENTIALS |
Warning when user tries to create/update a user with credentials that have previously been compromised by a public data breach. |
INTERNAL_STATE_FAILURE |
Warning when the operation succeeds but some non-critical workflow state failed. |
SqlInstanceState
The current serving state of the database instance.
| Enums | |
|---|---|
SQL_INSTANCE_STATE_UNSPECIFIED |
The state of the instance is unknown. |
RUNNABLE |
The instance is running, or has been stopped by owner. |
SUSPENDED |
The instance is not available, for example due to problems with billing. |
PENDING_DELETE |
The instance is being deleted. |
PENDING_CREATE |
The instance is being created. |
MAINTENANCE |
The instance is down for maintenance. |
FAILED |
The creation of the instance failed or a fatal error occurred during maintenance. |
ONLINE_MAINTENANCE |
Deprecated |
REPAIRING |
(Applicable to read pool nodes only.) The read pool node needs to be repaired. The database might be unavailable. |
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: ❌