Tool: list_timeseries
Lists time series data from the Google Cloud Monitoring API
The following sample demonstrate how to use curl to invoke the list_timeseries MCP tool.
| Curl Request |
|---|
curl --location 'https://monitoring.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "list_timeseries", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
The ListTimeSeries request.
ListTimeSeriesRequest
| JSON representation |
|---|
{ "name": string, "filter": string, "interval": { object ( |
| Fields | |
|---|---|
name |
Required. The project, organization or folder on which to execute the request. The format is: |
filter |
Required. A monitoring filter that specifies which time series should be returned. The filter must specify a single metric type, and can additionally specify metric labels and other information. For example: |
interval |
Required. The time interval for which results should be returned. Only time series that contain data points in the specified interval are included in the response. |
aggregation |
Specifies the alignment of data points in individual time series as well as how to combine the retrieved time series across specified labels. By default (if no |
secondaryAggregation |
Apply a second aggregation after |
orderBy |
Unsupported: must be left blank. The points in each time series are currently returned in reverse time order (most recent to oldest). |
view |
Required. Specifies which information is returned about the time series. |
pageSize |
A positive number that is the maximum number of results to return. If |
pageToken |
If this field is not empty then it must contain the |
TimeInterval
| JSON representation |
|---|
{ "endTime": string, "startTime": string } |
| Fields | |
|---|---|
endTime |
Required. The end of the time interval. 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 |
Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time. 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: |
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. |
Aggregation
| JSON representation |
|---|
{ "alignmentPeriod": string, "perSeriesAligner": enum ( |
| Fields | |
|---|---|
alignmentPeriod |
The The value must be at least 60 seconds. If a per-series aligner other than The maximum value of the A duration in seconds with up to nine fractional digits, ending with ' |
perSeriesAligner |
An Not all alignment operations may be applied to all time series. The valid choices depend on the Time series data must be aligned in order to perform cross-time series reduction. If |
crossSeriesReducer |
The reduction operation to be used to combine time series into a single time series, where the value of each data point in the resulting series is a function of all the already aligned values in the input time series. Not all reducer operations can be applied to all time series. The valid choices depend on the Time series data must first be aligned (see |
groupByFields[] |
The set of fields to preserve when |
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 |
Output Schema
The ListTimeSeries response.
ListTimeSeriesResponse
| JSON representation |
|---|
{ "timeSeries": [ { object ( |
| Fields | |
|---|---|
timeSeries[] |
One or more time series that match the filter included in the request. |
nextPageToken |
If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as |
executionErrors[] |
Query execution errors that may have caused the time series data returned to be incomplete. |
unit |
The unit in which all |
unreachable[] |
Cloud regions that were unreachable which may have caused incomplete data to be returned. |
TimeSeries
| JSON representation |
|---|
{ "metric": { object ( |
| Fields | |
|---|---|
metric |
The associated metric. A fully-specified metric used to identify the time series. |
resource |
The associated monitored resource. Custom metrics can use only certain monitored resource types in their time series data. For more information, see Monitored resources for custom metrics. |
metadata |
Output only. The associated monitored resource metadata. When reading a time series, this field will include metadata labels that are explicitly named in the reduction. When creating a time series, this field is ignored. |
metricKind |
The metric kind of the time series. When listing time series, this metric kind might be different from the metric kind of the associated metric if this time series is an alignment or reduction of other time series. When creating a time series, this field is optional. If present, it must be the same as the metric kind of the associated metric. If the associated metric's descriptor must be auto-created, then this field specifies the metric kind of the new descriptor and must be either |
valueType |
The value type of the time series. When listing time series, this value type might be different from the value type of the associated metric if this time series is an alignment or reduction of other time series. When creating a time series, this field is optional. If present, it must be the same as the type of the data in the |
points[] |
The data points of this time series. When listing time series, points are returned in reverse time order. When creating a time series, this field must contain exactly one point and the point's type must be the same as the value type of the associated metric. If the associated metric's descriptor must be auto-created, then the value type of the descriptor is determined by the point's type, which must be |
unit |
The units in which the metric value is reported. It is only applicable if the |
description |
Input only. A detailed description of the time series that will be associated with the |
Metric
| JSON representation |
|---|
{ "type": string, "labels": { string: string, ... } } |
| Fields | |
|---|---|
type |
An existing metric type, see |
labels |
The set of label values that uniquely identify this metric. All labels listed in the An object containing a list of |
LabelsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
MonitoredResource
| JSON representation |
|---|
{ "type": string, "labels": { string: string, ... } } |
| Fields | |
|---|---|
type |
Required. The monitored resource type. This field must match the |
labels |
Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels An object containing a list of |
LabelsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
MonitoredResourceMetadata
| JSON representation |
|---|
{ "systemLabels": { object }, "userLabels": { string: string, ... } } |
| Fields | |
|---|---|
systemLabels |
Output only. Values for predefined system metadata labels. System labels are a kind of metadata extracted by Google, including "machine_image", "vpc", "subnet_id", "security_group", "name", etc. System label values can be only strings, Boolean values, or a list of strings. For example: |
userLabels |
Output only. A map of user-defined metadata labels. An object containing a list of |
Struct
| JSON representation |
|---|
{ "fields": { string: value, ... } } |
| Fields | |
|---|---|
fields |
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key": string, "value": value } |
| Fields | |
|---|---|
key |
|
value |
|
Value
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of value. kind can be only one of the following: |
|
nullValue |
Represents a null value. |
numberValue |
Represents a double value. |
stringValue |
Represents a string value. |
boolValue |
Represents a boolean value. |
structValue |
Represents a structured value. |
listValue |
Represents a repeated |
ListValue
| JSON representation |
|---|
{ "values": [ value ] } |
| Fields | |
|---|---|
values[] |
Repeated field of dynamically typed values. |
UserLabelsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
Point
| JSON representation |
|---|
{ "interval": { object ( |
| Fields | |
|---|---|
interval |
The time interval to which the data point applies. For |
value |
The value of the data point. |
TimeInterval
| JSON representation |
|---|
{ "endTime": string, "startTime": string } |
| Fields | |
|---|---|
endTime |
Required. The end of the time interval. 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 |
Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time. 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: |
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. |
TypedValue
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field value. The typed value field. value can be only one of the following: |
|
boolValue |
A Boolean value: |
int64Value |
A 64-bit integer. Its range is approximately ±9.2x1018. |
doubleValue |
A 64-bit double-precision floating-point number. Its magnitude is approximately ±10±300 and it has 16 significant digits of precision. |
stringValue |
A variable-length string value. |
distributionValue |
A distribution value. |
Distribution
| JSON representation |
|---|
{ "count": string, "mean": number, "sumOfSquaredDeviation": number, "range": { object ( |
| Fields | |
|---|---|
count |
The number of values in the population. Must be non-negative. This value must equal the sum of the values in |
mean |
The arithmetic mean of the values in the population. If |
sumOfSquaredDeviation |
The sum of squared deviations from the mean of the values in the population. For values x_i this is: Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition describes Welford's method for accumulating this sum in one pass. If |
range |
If specified, contains the range of the population values. The field must not be present if the count is zero. This field is presently ignored by the Cloud Monitoring API v3. |
bucketOptions |
Required in the Cloud Monitoring API v3. Defines the histogram bucket boundaries. |
bucketCounts[] |
Required in the Cloud Monitoring API v3. The values for each bucket specified in |
exemplars[] |
Must be in increasing order of |
Range
| JSON representation |
|---|
{ "min": number, "max": number } |
| Fields | |
|---|---|
min |
The minimum of the population values. |
max |
The maximum of the population values. |
BucketOptions
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field options. Exactly one of these three fields must be set. options can be only one of the following: |
|
linearBuckets |
The linear bucket. |
exponentialBuckets |
The exponential buckets. |
explicitBuckets |
The explicit buckets. |
Linear
| JSON representation |
|---|
{ "numFiniteBuckets": integer, "width": number, "offset": number } |
| Fields | |
|---|---|
numFiniteBuckets |
Must be greater than 0. |
width |
Must be greater than 0. |
offset |
Lower bound of the first bucket. |
Exponential
| JSON representation |
|---|
{ "numFiniteBuckets": integer, "growthFactor": number, "scale": number } |
| Fields | |
|---|---|
numFiniteBuckets |
Must be greater than 0. |
growthFactor |
Must be greater than 1. |
scale |
Must be greater than 0. |
Explicit
| JSON representation |
|---|
{ "bounds": [ number ] } |
| Fields | |
|---|---|
bounds[] |
The values must be monotonically increasing. |
Exemplar
| JSON representation |
|---|
{ "value": number, "timestamp": string, "attachments": [ { "@type": string, field1: ..., ... } ] } |
| Fields | |
|---|---|
value |
Value of the exemplar point. This value determines to which bucket the exemplar belongs. |
timestamp |
The observation (sampling) time of the above value. 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: |
attachments[] |
Contextual information about the example value. Examples are: Trace: type.googleapis.com/google.monitoring.v3.SpanContext Literal string: type.googleapis.com/google.protobuf.StringValue Labels dropped during aggregation: type.googleapis.com/google.monitoring.v3.DroppedLabels There may be only a single attachment of any given message type in a single exemplar, and this is enforced by the system. An object containing fields of an arbitrary type. An additional field |
Any
| JSON representation |
|---|
{ "typeUrl": string, "value": string } |
| Fields | |
|---|---|
typeUrl |
A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one "/" character. The last segment of the URL's path must represent the fully qualified name of the type (as in In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme
Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. As of May 2023, there are no widely used type server implementations and no plans to implement one. Schemes other than |
value |
Must be a valid serialized protocol buffer of the above specified type. A base64-encoded string. |
Status
| JSON representation |
|---|
{ "code": integer, "message": string, "details": [ { "@type": string, field1: ..., ... } ] } |
| Fields | |
|---|---|
code |
The status code, which should be an enum value of |
message |
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the |
details[] |
A list of messages that carry the error details. There is a common set of message types for APIs to use. An object containing fields of an arbitrary type. An additional field |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌