Tool: list_group_stats
Use this tool ONLY to find and analyze recurring stack traces in your application. It aggregates similar stack traces, providing statistics like the number of occurrences and the number of affected users. DO NOT use this tool for general error searches or to view individual error logs. For queries asking to 'find errors', or 'show me errors', you MUST use list_log_entries tool. CRITICAL: Default to other tooling for generic questions about errors.
The following sample demonstrate how to use curl to invoke the list_group_stats MCP tool.
| Curl Request |
|---|
curl --location 'https://clouderrorreporting.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "list_group_stats", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Specifies a set of ErrorGroupStats to return.
Next ID: 19
ListGroupStatsRequest
| JSON representation |
|---|
{ "projectName": string, "groupId": [ string ], "serviceFilter": { object ( |
| Fields | |
|---|---|
projectName |
Required. The resource name of the Google Cloud Platform project. Written as Examples: For a list of supported locations, see Supported Regions. |
groupId[] |
Optional. List all |
serviceFilter |
Optional. List only |
timeRange |
Optional. List data for the given time range. If not set, a default time range is used. The field |
timedCountDuration |
Optional. The preferred duration for a single returned A duration in seconds with up to nine fractional digits, ending with ' |
alignment |
Optional. The alignment of the timed counts to be returned. Default is |
alignmentTime |
Optional. Time where the timed counts shall be aligned if rounded alignment is chosen. Default is 00:00 UTC. 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: |
order |
Optional. The sort order in which the results are returned. Default is |
pageSize |
Optional. The maximum number of results to return per response. Default is 20. |
pageToken |
Optional. A |
ServiceContextFilter
| JSON representation |
|---|
{ "service": string, "version": string, "resourceType": string } |
| Fields | |
|---|---|
service |
Optional. The exact value to match against |
version |
Optional. The exact value to match against |
resourceType |
Optional. The exact value to match against |
QueryTimeRange
| JSON representation |
|---|
{
"period": enum ( |
| Fields | |
|---|---|
period |
Restricts the query to the specified time range. |
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 |
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. |
Output Schema
Contains a set of requested error group stats.
ListGroupStatsResponse
| JSON representation |
|---|
{
"errorGroupStats": [
{
object ( |
| Fields | |
|---|---|
errorGroupStats[] |
The error group stats which match the given request. |
nextPageToken |
If non-empty, more results are available. Pass this token, along with the same query parameters as the first request, to view the next page of results. |
timeRangeBegin |
The timestamp specifies the start time to which the request was restricted. The start time is set based on the requested time range. It may be adjusted to a later time if a project has exceeded the storage quota and older data has been deleted. 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: |
ErrorGroupStats
| JSON representation |
|---|
{ "group": { object ( |
| Fields | |
|---|---|
group |
Group data that is independent of the filter criteria. |
count |
Approximate total number of events in the given group that match the filter criteria. |
affectedUsersCount |
Approximate number of affected users in the given group that match the filter criteria. Users are distinguished by data in the |
timedCounts[] |
Approximate number of occurrences over time. Timed counts returned by ListGroups are guaranteed to be:
|
firstSeenTime |
Approximate first occurrence that was ever seen for this group and which matches the given filter criteria, ignoring the time_range that was specified in the request. 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: |
lastSeenTime |
Approximate last occurrence that was ever seen for this group and which matches the given filter criteria, ignoring the time_range that was specified in the request. 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: |
affectedServices[] |
Service contexts with a non-zero error count for the given filter criteria. This list can be truncated if multiple services are affected. Refer to |
numAffectedServices |
The total number of services with a non-zero error count for the given filter criteria. |
representative |
An arbitrary event that is chosen as representative for the whole group. The representative event is intended to be used as a quick preview for the whole group. Events in the group are usually sufficiently similar to each other such that showing an arbitrary representative provides insight into the characteristics of the group as a whole. |
ErrorGroup
| JSON representation |
|---|
{ "name": string, "groupId": string, "trackingIssues": [ { object ( |
| Fields | |
|---|---|
name |
The group resource name. Written as Examples: In the group resource name, the For a list of supported locations, see Supported Regions. |
groupId |
An opaque identifier of the group. This field is assigned by the Error Reporting system and always populated. In the group resource name, the |
trackingIssues[] |
Associated tracking issues. |
resolutionStatus |
Error group's resolution status. An unspecified resolution status will be interpreted as OPEN |
TrackingIssue
| JSON representation |
|---|
{ "url": string } |
| Fields | |
|---|---|
url |
A URL pointing to a related entry in an issue tracking system. Example: |
TimedCount
| JSON representation |
|---|
{ "count": string, "startTime": string, "endTime": string } |
| Fields | |
|---|---|
count |
Approximate number of occurrences in the given time period. |
startTime |
Start of the time period to which 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: |
endTime |
End of the time period to which 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. |
ServiceContext
| JSON representation |
|---|
{ "service": string, "version": string, "resourceType": string } |
| Fields | |
|---|---|
service |
An identifier of the service, such as the name of the executable, job, or Google App Engine service name. This field is expected to have a low number of values that are relatively stable over time, as opposed to Contains the service name for error reports extracted from Google App Engine logs or |
version |
Represents the source code version that the developer provided, which could represent a version label or a Git SHA-1 hash, for example. For App Engine standard environment, the version is set to the version of the app. |
resourceType |
Type of the MonitoredResource. List of possible values: https://cloud.google.com/monitoring/api/resources Value is set automatically for incoming errors and must not be set when reporting errors. |
ErrorEvent
| JSON representation |
|---|
{ "eventTime": string, "serviceContext": { object ( |
| Fields | |
|---|---|
eventTime |
Time when the event occurred as provided in the error report. If the report did not contain a timestamp, the time the error was received by the Error Reporting system is used. 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: |
serviceContext |
The |
message |
The stack trace that was reported or logged by the service. |
context |
Data about the context in which the error occurred. |
ErrorContext
| JSON representation |
|---|
{ "httpRequest": { object ( |
| Fields | |
|---|---|
httpRequest |
The HTTP request which was processed when the error was triggered. |
user |
The user who caused or was affected by the crash. This can be a user ID, an email address, or an arbitrary token that uniquely identifies the user. When sending an error report, leave this field empty if the user was not logged in. In this case the Error Reporting system will use other data, such as remote IP address, to distinguish affected users. See |
reportLocation |
The location in the source code where the decision was made to report the error, usually the place where it was logged. For a logged exception this would be the source line where the exception is logged, usually close to the place where it was caught. |
sourceReferences[] |
Source code that was used to build the executable which has caused the given error message. |
HttpRequestContext
| JSON representation |
|---|
{ "method": string, "url": string, "userAgent": string, "referrer": string, "responseStatusCode": integer, "remoteIp": string } |
| Fields | |
|---|---|
method |
The type of HTTP request, such as |
url |
The URL of the request. |
userAgent |
The user agent information that is provided with the request. |
referrer |
The referrer information that is provided with the request. |
responseStatusCode |
The HTTP response status code for the request. |
remoteIp |
The IP address from which the request originated. This can be IPv4, IPv6, or a token which is derived from the IP address, depending on the data that has been provided in the error report. |
SourceLocation
| JSON representation |
|---|
{ "filePath": string, "lineNumber": integer, "functionName": string } |
| Fields | |
|---|---|
filePath |
The source code filename, which can include a truncated relative path, or a full path from a production machine. |
lineNumber |
1-based. 0 indicates that the line number is unknown. |
functionName |
Human-readable name of a function or method. The value can include optional context like the class or package name. For example, |
SourceReference
| JSON representation |
|---|
{ "repository": string, "revisionId": string } |
| Fields | |
|---|---|
repository |
Optional. A URI string identifying the repository. Example: "https://github.com/GoogleCloudPlatform/kubernetes.git" |
revisionId |
The canonical and persistent identifier of the deployed revision. Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌