Tool: check_compatibility
This compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility.
The following sample demonstrate how to use curl to invoke the check_compatibility MCP tool.
| Curl Request |
|---|
curl --location 'https://analyticsdata.googleapis.com/mcp/v1' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "check_compatibility", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
The request for compatibility information for a report's dimensions and metrics. Check compatibility provides a preview of the compatibility of a report; fields shared with the runReport request should be the same values as in your runReport request.
CheckCompatibilityRequest
| JSON representation |
|---|
{ "property": string, "dimensions": [ { object ( |
| Fields | |
|---|---|
property |
A Google Analytics property identifier whose events are tracked. To learn more, see where to find your Property ID. Example: properties/1234 |
dimensions[] |
The dimensions in this report. |
metrics[] |
The metrics in this report. |
dimensionFilter |
The filter clause of dimensions. |
metricFilter |
The filter clause of metrics. |
compatibilityFilter |
Filters the dimensions and metrics in the response to just this compatibility. Commonly used as |
Dimension
| JSON representation |
|---|
{
"name": string,
"dimensionExpression": {
object ( |
| Fields | |
|---|---|
name |
The name of the dimension. See the API Dimensions for the list of dimension names supported by core reporting methods such as If Dimensions are referenced by |
dimensionExpression |
One dimension can be the result of an expression of multiple dimensions. For example, dimension "country, city": concatenate(country, ", ", city). |
DimensionExpression
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field one_expression. Specify one type of dimension expression for DimensionExpression. one_expression can be only one of the following: |
|
lowerCase |
Used to convert a dimension value to lower case. |
upperCase |
Used to convert a dimension value to upper case. |
concatenate |
Used to combine dimension values to a single dimension. For example, dimension "country, city": concatenate(country, ", ", city). |
CaseExpression
| JSON representation |
|---|
{ "dimensionName": string } |
| Fields | |
|---|---|
dimensionName |
Name of a dimension. The name must refer back to a name in dimensions field of the request. |
ConcatenateExpression
| JSON representation |
|---|
{ "dimensionNames": [ string ], "delimiter": string } |
| Fields | |
|---|---|
dimensionNames[] |
Names of dimensions. The names must refer back to names in the dimensions field of the request. |
delimiter |
The delimiter placed between dimension names. Delimiters are often single characters such as "|" or "," but can be longer strings. If a dimension value contains the delimiter, both will be present in response with no distinction. For example if dimension 1 value = "US,FR", dimension 2 value = "JP", and delimiter = ",", then the response will contain "US,FR,JP". |
Metric
| JSON representation |
|---|
{ "name": string, "expression": string, "invisible": boolean } |
| Fields | |
|---|---|
name |
The name of the metric. See the API Metrics for the list of metric names supported by core reporting methods such as If Metrics are referenced by |
expression |
A mathematical expression for derived metrics. For example, the metric Event count per user is |
invisible |
Indicates if a metric is invisible in the report response. If a metric is invisible, the metric will not produce a column in the response, but can be used in |
FilterExpression
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field expr. Specify one type of filter expression for FilterExpression. expr can be only one of the following: |
|
andGroup |
The FilterExpressions in and_group have an AND relationship. |
orGroup |
The FilterExpressions in or_group have an OR relationship. |
notExpression |
The FilterExpression is NOT of not_expression. |
filter |
A primitive filter. In the same FilterExpression, all of the filter's field names need to be either all dimensions or all metrics. |
FilterExpressionList
| JSON representation |
|---|
{
"expressions": [
{
object ( |
| Fields | |
|---|---|
expressions[] |
A list of filter expressions. |
Filter
| JSON representation |
|---|
{ "fieldName": string, // Union field |
| Fields | |
|---|---|
fieldName |
The dimension name or metric name. In most methods, dimensions & metrics can be used for the first time in this field. However in a RunPivotReportRequest, this field must be additionally specified by name in the RunPivotReportRequest's dimensions or metrics. |
Union field one_filter. Specify one type of filter for Filter. one_filter can be only one of the following: |
|
stringFilter |
Strings related filter. |
inListFilter |
A filter for in list values. |
numericFilter |
A filter for numeric or date values. |
betweenFilter |
A filter for two values. |
emptyFilter |
A filter for empty values such as "(not set)" and "" values. |
StringFilter
| JSON representation |
|---|
{
"matchType": enum ( |
| Fields | |
|---|---|
matchType |
The match type for this filter. |
value |
The string value used for the matching. |
caseSensitive |
If true, the string value is case sensitive. |
InListFilter
| JSON representation |
|---|
{ "values": [ string ], "caseSensitive": boolean } |
| Fields | |
|---|---|
values[] |
The list of string values. Must be non-empty. |
caseSensitive |
If true, the string value is case sensitive. |
NumericFilter
| JSON representation |
|---|
{ "operation": enum ( |
| Fields | |
|---|---|
operation |
The operation type for this filter. |
value |
A numeric value or a date value. |
NumericValue
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field one_value. One of a numeric value one_value can be only one of the following: |
|
int64Value |
Integer value |
doubleValue |
Double value |
BetweenFilter
| JSON representation |
|---|
{ "fromValue": { object ( |
| Fields | |
|---|---|
fromValue |
Begins with this number. |
toValue |
Ends with this number. |
MatchType
The match type of a string filter
| Enums | |
|---|---|
MATCH_TYPE_UNSPECIFIED |
Unspecified |
EXACT |
Exact match of the string value. |
BEGINS_WITH |
Begins with the string value. |
ENDS_WITH |
Ends with the string value. |
CONTAINS |
Contains the string value. |
FULL_REGEXP |
Full match for the regular expression with the string value. |
PARTIAL_REGEXP |
Partial match for the regular expression with the string value. |
Operation
The operation applied to a numeric filter
| Enums | |
|---|---|
OPERATION_UNSPECIFIED |
Unspecified. |
EQUAL |
Equal |
LESS_THAN |
Less than |
LESS_THAN_OR_EQUAL |
Less than or equal |
GREATER_THAN |
Greater than |
GREATER_THAN_OR_EQUAL |
Greater than or equal |
Compatibility
The compatibility types for a single dimension or metric.
| Enums | |
|---|---|
COMPATIBILITY_UNSPECIFIED |
Unspecified compatibility. |
COMPATIBLE |
The dimension or metric is compatible. This dimension or metric can be successfully added to a report. |
INCOMPATIBLE |
The dimension or metric is incompatible. This dimension or metric cannot be successfully added to a report. |
Output Schema
The compatibility response with the compatibility of each dimension & metric.
CheckCompatibilityResponse
| JSON representation |
|---|
{ "dimensionCompatibilities": [ { object ( |
| Fields | |
|---|---|
dimensionCompatibilities[] |
The compatibility of each dimension. |
metricCompatibilities[] |
The compatibility of each metric. |
DimensionCompatibility
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field
|
|
dimensionMetadata |
The dimension metadata contains the API name for this compatibility information. The dimension metadata also contains other helpful information like the UI name and description. |
Union field
|
|
compatibility |
The compatibility of this dimension. If the compatibility is COMPATIBLE, this dimension can be successfully added to the report. |
DimensionMetadata
| JSON representation |
|---|
{ "apiName": string, "uiName": string, "description": string, "deprecatedApiNames": [ string ], "customDefinition": boolean, "category": string } |
| Fields | |
|---|---|
apiName |
This dimension's name. Useable in Dimension's |
uiName |
This dimension's name within the Google Analytics user interface. For example, |
description |
Description of how this dimension is used and calculated. |
deprecatedApiNames[] |
Still usable but deprecated names for this dimension. If populated, this dimension is available by either |
customDefinition |
True if the dimension is custom to this property. This includes user, event, & item scoped custom dimensions; to learn more about custom dimensions, see https://support.google.com/analytics/answer/14240153. This also include custom channel groups; to learn more about custom channel groups, see https://support.google.com/analytics/answer/13051316. |
category |
The display name of the category that this dimension belongs to. Similar dimensions and metrics are categorized together. |
MetricCompatibility
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field
|
|
metricMetadata |
The metric metadata contains the API name for this compatibility information. The metric metadata also contains other helpful information like the UI name and description. |
Union field
|
|
compatibility |
The compatibility of this metric. If the compatibility is COMPATIBLE, this metric can be successfully added to the report. |
MetricMetadata
| JSON representation |
|---|
{ "apiName": string, "uiName": string, "description": string, "deprecatedApiNames": [ string ], "type": enum ( |
| Fields | |
|---|---|
apiName |
A metric name. Useable in Metric's |
uiName |
This metric's name within the Google Analytics user interface. For example, |
description |
Description of how this metric is used and calculated. |
deprecatedApiNames[] |
Still usable but deprecated names for this metric. If populated, this metric is available by either |
type |
The type of this metric. |
expression |
The mathematical expression for this derived metric. Can be used in Metric's |
customDefinition |
True if the metric is a custom metric for this property. |
blockedReasons[] |
If reasons are specified, your access is blocked to this metric for this property. API requests from you to this property for this metric will succeed; however, the report will contain only zeros for this metric. API requests with metric filters on blocked metrics will fail. If reasons are empty, you have access to this metric. To learn more, see Access and data-restriction management. |
category |
The display name of the category that this metrics belongs to. Similar dimensions and metrics are categorized together. |
Compatibility
The compatibility types for a single dimension or metric.
| Enums | |
|---|---|
COMPATIBILITY_UNSPECIFIED |
Unspecified compatibility. |
COMPATIBLE |
The dimension or metric is compatible. This dimension or metric can be successfully added to a report. |
INCOMPATIBLE |
The dimension or metric is incompatible. This dimension or metric cannot be successfully added to a report. |
MetricType
A metric's value type.
| Enums | |
|---|---|
METRIC_TYPE_UNSPECIFIED |
Unspecified type. |
TYPE_INTEGER |
Integer type. |
TYPE_FLOAT |
Floating point type. |
TYPE_SECONDS |
A duration of seconds; a special floating point type. |
TYPE_MILLISECONDS |
A duration in milliseconds; a special floating point type. |
TYPE_MINUTES |
A duration in minutes; a special floating point type. |
TYPE_HOURS |
A duration in hours; a special floating point type. |
TYPE_STANDARD |
A custom metric of standard type; a special floating point type. |
TYPE_CURRENCY |
An amount of money; a special floating point type. |
TYPE_FEET |
A length in feet; a special floating point type. |
TYPE_MILES |
A length in miles; a special floating point type. |
TYPE_METERS |
A length in meters; a special floating point type. |
TYPE_KILOMETERS |
A length in kilometers; a special floating point type. |
BlockedReason
Justifications for why this metric is blocked.
| Enums | |
|---|---|
BLOCKED_REASON_UNSPECIFIED |
Will never be specified in API response. |
NO_REVENUE_METRICS |
If present, your access is blocked to revenue related metrics for this property, and this metric is revenue related. |
NO_COST_METRICS |
If present, your access is blocked to cost related metrics for this property, and this metric is cost related. |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ✅