Tool: get_instance
Get information about a Spanner instance
The following sample demonstrate how to use curl to invoke the get_instance MCP tool.
| Curl Request |
|---|
curl --location 'https://spanner.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "get_instance", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
The request for GetInstance.
GetInstanceRequest
| JSON representation |
|---|
{ "name": string, "fieldMask": string } |
| Fields | |
|---|---|
name |
Required. The name of the requested instance. Values are of the form |
fieldMask |
If field_mask is present, specifies the subset of This is a comma-separated list of fully qualified names of fields. Example: |
FieldMask
| JSON representation |
|---|
{ "paths": [ string ] } |
| Fields | |
|---|---|
paths[] |
The set of field mask paths. |
Output Schema
An isolated set of Cloud Spanner resources on which databases can be hosted.
Instance
| JSON representation |
|---|
{ "name": string, "config": string, "displayName": string, "nodeCount": integer, "processingUnits": integer, "replicaComputeCapacity": [ { object ( |
| Fields | |
|---|---|
name |
Required. A unique identifier for the instance, which cannot be changed after the instance is created. Values are of the form |
config |
Required. The name of the instance's configuration. Values are of the form |
displayName |
Required. The descriptive name for this instance as it appears in UIs. Must be unique per project and between 4 and 30 characters in length. |
nodeCount |
The number of nodes allocated to this instance. At most, one of either Users can set the If autoscaling is enabled, This might be zero in API responses for instances that are not yet in the If the instance has varying node count across replicas (achieved by setting For more information, see Compute capacity, nodes, and processing units. |
processingUnits |
The number of processing units allocated to this instance. At most, one of either Users can set the If autoscaling is enabled, This might be zero in API responses for instances that are not yet in the If the instance has varying processing units per replica (achieved by setting For more information, see Compute capacity, nodes and processing units. |
replicaComputeCapacity[] |
Output only. Lists the compute capacity per ReplicaSelection. A replica selection identifies a set of replicas with common properties. Replicas identified by a ReplicaSelection are scaled with the same compute capacity. |
autoscalingConfig |
Optional. The autoscaling configuration. Autoscaling is enabled if this field is set. When autoscaling is enabled, node_count and processing_units are treated as OUTPUT_ONLY fields and reflect the current compute capacity allocated to the instance. |
state |
Output only. The current instance state. For |
labels |
Cloud Labels are a flexible and lightweight mechanism for organizing cloud resources into groups that reflect a customer's organizational needs and deployment strategies. Cloud Labels can be used to filter collections of resources. They can be used to control how resource metrics are aggregated. And they can be used as arguments to policy management rules (e.g. route, firewall, load balancing, etc.).
See https://goo.gl/xmQnxf for more information on and examples of labels. If you plan to use labels in your own code, please note that additional characters may be allowed in the future. And so you are advised to use an internal label representation, such as JSON, which doesn't rely upon specific characters being disallowed. For example, representing labels as the string: name + "_" + value would prove problematic if we were to allow "_" in a future release. An object containing a list of |
instanceType |
The |
endpointUris[] |
Deprecated. This field is not populated. |
createTime |
Output only. The time at which the instance was created. 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: |
updateTime |
Output only. The time at which the instance was most recently updated. 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: |
freeInstanceMetadata |
Free instance metadata. Only populated for free instances. |
edition |
Optional. The |
defaultBackupScheduleType |
Optional. Controls the default backup schedule behavior for new databases within the instance. By default, a backup schedule is created automatically when a new database is created in a new instance. Note that the In the |
ReplicaComputeCapacity
| JSON representation |
|---|
{ "replicaSelection": { object ( |
| Fields | |
|---|---|
replicaSelection |
Required. Identifies replicas by specified properties. All replicas in the selection have the same amount of compute capacity. |
Union field compute_capacity. Compute capacity allocated to each replica identified by the specified selection. The unit is selected based on the unit used to specify the instance size for non-autoscaling instances, or the unit used in autoscaling limit for autoscaling instances. compute_capacity can be only one of the following: |
|
nodeCount |
The number of nodes allocated to each replica. This may be zero in API responses for instances that are not yet in state |
processingUnits |
The number of processing units allocated to each replica. This may be zero in API responses for instances that are not yet in state |
ReplicaSelection
| JSON representation |
|---|
{ "location": string } |
| Fields | |
|---|---|
location |
Required. Name of the location of the replicas (for example, "us-central1"). |
AutoscalingConfig
| JSON representation |
|---|
{ "autoscalingLimits": { object ( |
| Fields | |
|---|---|
autoscalingLimits |
Required. Autoscaling limits for an instance. |
autoscalingTargets |
Required. The autoscaling targets for an instance. |
asymmetricAutoscalingOptions[] |
Optional. Optional asymmetric autoscaling options. Replicas matching the replica selection criteria will be autoscaled independently from other replicas. The autoscaler will scale the replicas based on the utilization of replicas identified by the replica selection. Replica selections should not overlap with each other. Other replicas (those do not match any replica selection) will be autoscaled together and will have the same compute capacity allocated to them. |
AutoscalingLimits
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field min_limit. The minimum compute capacity for the instance. min_limit can be only one of the following: |
|
minNodes |
Minimum number of nodes allocated to the instance. If set, this number should be greater than or equal to 1. |
minProcessingUnits |
Minimum number of processing units allocated to the instance. If set, this number should be multiples of 1000. |
Union field max_limit. The maximum compute capacity for the instance. The maximum compute capacity should be less than or equal to 10X the minimum compute capacity. max_limit can be only one of the following: |
|
maxNodes |
Maximum number of nodes allocated to the instance. If set, this number should be greater than or equal to min_nodes. |
maxProcessingUnits |
Maximum number of processing units allocated to the instance. If set, this number should be multiples of 1000 and be greater than or equal to min_processing_units. |
AutoscalingTargets
| JSON representation |
|---|
{ "highPriorityCpuUtilizationPercent": integer, "totalCpuUtilizationPercent": integer, "storageUtilizationPercent": integer } |
| Fields | |
|---|---|
highPriorityCpuUtilizationPercent |
Optional. The target high priority cpu utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization). The valid range is [10, 90] inclusive. If not specified or set to 0, the autoscaler skips scaling based on high priority CPU utilization. |
totalCpuUtilizationPercent |
Optional. The target total CPU utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization). The valid range is [10, 90] inclusive. If not specified or set to 0, the autoscaler skips scaling based on total CPU utilization. If both |
storageUtilizationPercent |
Required. The target storage utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization). The valid range is [10, 99] inclusive. |
AsymmetricAutoscalingOption
| JSON representation |
|---|
{ "replicaSelection": { object ( |
| Fields | |
|---|---|
replicaSelection |
Required. Selects the replicas to which this AsymmetricAutoscalingOption applies. Only read-only replicas are supported. |
overrides |
Optional. Overrides applied to the top-level autoscaling configuration for the selected replicas. |
AutoscalingConfigOverrides
| JSON representation |
|---|
{
"autoscalingLimits": {
object ( |
| Fields | |
|---|---|
autoscalingLimits |
Optional. If specified, overrides the min/max limit in the top-level autoscaling configuration for the selected replicas. |
autoscalingTargetHighPriorityCpuUtilizationPercent |
Optional. If specified, overrides the autoscaling target high_priority_cpu_utilization_percent in the top-level autoscaling configuration for the selected replicas. |
autoscalingTargetTotalCpuUtilizationPercent |
Optional. If specified, overrides the autoscaling target |
disableHighPriorityCpuAutoscaling |
Optional. If true, disables high priority CPU autoscaling for the selected replicas and ignores When setting this field to true, setting If false, the Setting both |
disableTotalCpuAutoscaling |
Optional. If true, disables total CPU autoscaling for the selected replicas and ignores When setting this field to true, setting If false, the Setting both |
LabelsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
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. |
FreeInstanceMetadata
| JSON representation |
|---|
{
"expireTime": string,
"upgradeTime": string,
"expireBehavior": enum ( |
| Fields | |
|---|---|
expireTime |
Output only. Timestamp after which the instance will either be upgraded or scheduled for deletion after a grace period. ExpireBehavior is used to choose between upgrading or scheduling the free instance for deletion. This timestamp is set during the creation of a free instance. 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: |
upgradeTime |
Output only. If present, the timestamp at which the free instance was upgraded to a provisioned instance. 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: |
expireBehavior |
Specifies the expiration behavior of a free instance. The default of ExpireBehavior is |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ❌ | Read Only Hint: ✅ | Open World Hint: ❌