MCP Tools Reference: cloudtrace.googleapis.com

Tool: list_traces

Use this as the primary tool to retrieve and examine distributed traces from Google Cloud Trace. Traces provide a detailed view of the path of a request as it travels through your application's services. This is essential for understanding latency issues and debugging complex, multi-service workflows. This will only return the root trace span, to gather full information call get_trace with that id.

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

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

Input Schema

The request message for the ListTraces method. All fields are required unless specified.

ListTracesRequest

JSON representation
 { 
 "projectId" 
 : 
 string 
 , 
 "view" 
 : 
 enum ( ViewType 
) 
 , 
 "pageSize" 
 : 
 integer 
 , 
 "pageToken" 
 : 
 string 
 , 
 "startTime" 
 : 
 string 
 , 
 "endTime" 
 : 
 string 
 , 
 "filter" 
 : 
 string 
 , 
 "orderBy" 
 : 
 string 
 } 
Fields
projectId

string

Required. ID of the Cloud project where the trace data is stored.

view

enum ( ViewType )

Optional. Type of data returned for traces in the list. Default is MINIMAL .

pageSize

integer

Optional. Maximum number of traces to return. If not specified or <= 0, the implementation selects a reasonable value. The implementation may return fewer traces than the requested page size.

pageToken

string

Token identifying the page of results to return. If provided, use the value of the next_page_token field from a previous request.

startTime

string ( Timestamp format)

Start of the time interval (inclusive) during which the trace data was collected from the application.

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)

End of the time interval (inclusive) during which the trace data was collected from the application.

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" .

filter

string

Optional. A filter against properties of the trace. See filter syntax documentation for details.

orderBy

string

Optional. Field used to sort the returned traces. Can be one of the following:

  • trace_id
  • name ( name field of root span in the trace)
  • duration (difference between end_time and start_time fields of the root span)
  • start ( start_time field of the root span)

Descending order can be specified by appending desc to the sort field (for example, name desc ).

Only one sort field is permitted.

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.

Output Schema

The response message for the ListTraces method.

ListTracesResponse

JSON representation
 { 
 "traces" 
 : 
 [ 
 { 
 object (  Trace 
 
) 
 } 
 ] 
 , 
 "nextPageToken" 
 : 
 string 
 } 
Fields
traces[]

object ( Trace )

List of trace records as specified by the view parameter.

nextPageToken

string

If defined, indicates that there are more traces that match the request and that this value should be passed to the next request to continue retrieving additional traces.

Trace

JSON representation
 { 
 "projectId" 
 : 
 string 
 , 
 "traceId" 
 : 
 string 
 , 
 "spans" 
 : 
 [ 
 { 
 object (  TraceSpan 
 
) 
 } 
 ] 
 } 
Fields
projectId

string

Project ID of the Cloud project where the trace data is stored.

traceId

string

Globally unique identifier for the trace. This identifier is a 128-bit numeric value formatted as a 32-byte hex string. For example, 382d4f4c6b7bb2f4a972559d9085001d . The numeric value should not be zero.

spans[]

object ( TraceSpan )

Collection of spans in the trace.

TraceSpan

JSON representation
 { 
 "spanId" 
 : 
 string 
 , 
 "kind" 
 : 
 enum ( SpanKind 
) 
 , 
 "name" 
 : 
 string 
 , 
 "startTime" 
 : 
 string 
 , 
 "endTime" 
 : 
 string 
 , 
 "parentSpanId" 
 : 
 string 
 , 
 "labels" 
 : 
 { 
 string 
 : 
 string 
 , 
 ... 
 } 
 } 
Fields
spanId

string ( uint64 format)

Identifier for the span. Must be a 64-bit integer other than 0 and unique within a trace. For example, 2205310701640571284 .

kind

enum ( SpanKind )

Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using RPC_CLIENT and RPC_SERVER to identify queueing latency associated with the span.

name

string

Name of the span. Must be less than 128 bytes. The span name is sanitized and displayed in the Trace tool in the Google Cloud Platform Console. The name may be a method name or some other per-call site name. For the same executable and the same call point, a best practice is to use a consistent name, which makes it easier to correlate cross-trace spans.

startTime

string ( Timestamp format)

Start time of the span in seconds and nanoseconds from the UNIX epoch.

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)

End time of the span in seconds and nanoseconds from the UNIX epoch.

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" .

parentSpanId

string ( uint64 format)

Optional. ID of the parent span, if any.

labels

map (key: string, value: string)

Collection of labels associated with the span. Label keys must be less than 128 bytes. Label values must be less than 16 KiB. Some keys might have predefined meaning, and you can also create your own.

For more information, see Cloud Trace labels .

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.

LabelsEntry

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

string

value

string

Tool Annotations

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

Design a Mobile Site
View Site in Mobile | Classic
Share by: