MCP Tools Reference: databaseinsights.googleapis.com

Tool: get_advanced_time_series_wait_event_stats

Fetches time-series history of wait event statistics to analyze contention trends for a requested AlloyDB instance within a specified time period. Supports filtering by database name, database user, and a specific query ID, as well as selecting the aggregation level (by wait class or granular wait event). Returns time-series data including rate of time spent (rate(time_spent)) grouped by wait class or event. Requires advanced query insights to be enabled.

The following sample demonstrate how to use curl to invoke the get_advanced_time_series_wait_event_stats MCP tool.

Curl Request
                  
curl --location 'https://LOCATION-databaseinsights.googleapis.com/mcp' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "get_advanced_time_series_wait_event_stats",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

Replace LOCATION with the location of your AlloyDB instance (for example, if your instance is in us-east7, use https://us-east7-databaseinsights.googleapis.com/mcp).

Input Schema

Message for fetching time-series history of wait event statistics (rate of time spent, grouped by wait class or event) for the requested instance.

FetchWaitEventTimeSeriesRequest

JSON representation
{
  "parent": string,
  "fullResourceName": string,
  "startTime": string,
  "endTime": string,
  "database": string,
  "username": string,
  "queryId": string,
  "view": enum (WaitEventView)
}
Fields
parent

string

Required. The name of the location where we request history. Format: projects/{project}/locations/{location}

fullResourceName

string

Required. Identifies the AlloyDB instance. //alloydb.googleapis.com/clusters/{cluster}/instances/{instance}

startTime

string

Optional. The beginning of the interval for fetching stats in RFC3339 format.

endTime

string

Optional. The end of the interval for fetching stats in RFC3339 format.

database

string

Optional. Filters results to a specific database name.

username

string

Optional. Filters results to a specific database user.

queryId

string (int64 format)

Optional. Fetches history for a specific query id.

view

enum (WaitEventView)

Optional. The view used to group the wait event results. Defaults to WAIT_CLASS.

WaitEventView

Defines the aggregation level for wait statistics.

Enums
WAIT_EVENT_VIEW_UNSPECIFIED The view is not specified.
WAIT_CLASS Default: Aggregates by wait class (e.g., IO, Lock, CPU).
WAIT_EVENT Granular: Aggregates by specific wait event (e.g., DataFileRead, ClientWrite).

Output Schema

Response message containing time-series history of wait event statistics (rate of time spent, grouped by wait class or event).

FetchWaitEventTimeSeriesResponse

JSON representation
{
  "timeseries": [
    {
      object (TimeSeries)
    }
  ],
  "metadata": {
    object (ResultSetMetadata)
  }
}
Fields
timeseries[]

object (TimeSeries)

Structured time-series data grouped by wait class.

metadata

object (ResultSetMetadata)

Metadata for the time series values.

TimeSeries

JSON representation
{
  "groupbyFieldValues": [
    string
  ],
  "values": [
    {
      object (TimeSeriesMetricValues)
    }
  ]
}
Fields
groupbyFieldValues[]

string

Contains the same fields in the same order as in input request.

values[]

object (TimeSeriesMetricValues)

Contains timeseries data for the metric.

TimeSeriesMetricValues

JSON representation
{
  "interval": {
    object (Interval)
  },
  "value": value,
  "metadata": {
    object
  }
}
Fields
interval

object (Interval)

Represents tumble interval start timestamp.

value

value (Value format)

Contains the metric values for the time interval.

metadata

object (Struct format)

Field that contains the trace ID / span ID.

Interval

JSON representation
{
  "startTime": string,
  "endTime": string
}
Fields
startTime

string (Timestamp format)

Optional. Inclusive start of the interval.

If specified, a Timestamp matching this interval will have to be the same or after the start.

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: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

endTime

string (Timestamp format)

Optional. Exclusive end of the interval.

If specified, a Timestamp matching this interval will have to be before the end.

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: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

Timestamp

JSON representation
{
  "seconds": string,
  "nanos": integer
}
Fields
seconds

string (int64 format)

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

integer

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.

Value

JSON representation
{

  // Union field kind can be only one of the following:
  "nullValue": null,
  "numberValue": number,
  "stringValue": string,
  "boolValue": boolean,
  "structValue": {
    object
  },
  "listValue": array
  // End of list of possible types for union field kind.
}
Fields
Union field kind. The kind of value. kind can be only one of the following:
nullValue

null

Represents a JSON null.

numberValue

number

Represents a JSON number. Must not be NaN, Infinity or -Infinity, since those are not supported in JSON. This also cannot represent large Int64 values, since JSON format generally does not support them in its number type.

stringValue

string

Represents a JSON string.

boolValue

boolean

Represents a JSON boolean (true or false literal in JSON).

structValue

object (Struct format)

Represents a JSON object.

listValue

array (ListValue format)

Represents a JSON array.

Struct

JSON representation
{
  "fields": {
    string: value,
    ...
  }
}
Fields
fields

map (key: string, value: value (Value format))

Unordered map of dynamically typed values.

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

FieldsEntry

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

string

value

value (Value format)

ListValue

JSON representation
{
  "values": [
    value
  ]
}
Fields
values[]

value (Value format)

Repeated field of dynamically typed values.

ResultSetMetadata

JSON representation
{
  "fields": [
    {
      object (Field)
    }
  ]
}
Fields
fields[]

object (Field)

Information on all columns of the result row.

Field

JSON representation
{
  "name": string,
  "type": enum (FieldType),
  "description": string
}
Fields
name

string

Field name according to the public schema.

type

enum (FieldType)

Field type defined according to the public schema or depends on the aggregation method in case of an aggregation field.

description

string

Description of the value the field holds.

NullValue

Represents a JSON null.

NullValue is a sentinel, using an enum with only one value to represent the null value for the Value type union.

A field of type NullValue with any value other than 0 is considered invalid. Most ProtoJSON serializers will emit a Value with a null_value set as a JSON null regardless of the integer value, and so will round trip to a 0 value.

Enums
NULL_VALUE Null value.

FieldType

Type of field, which will define how to read a particular key.

Enums
FIELD_TYPE_UNSPECIFIED Field type is unknown.
INT64 Int64 field type.
UINT64 Unsigned int64 field type.
INT32 Int32 field type.
UINT32 Unsigned int64 field type.
STRING String field type.
DOUBLE Double based data type.
ARRAY Trace info type.
BOOL Boolean field type.

Tool Annotations

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