Skip to main content
Glama

analyticsadmin.properties.customMetrics.patch

Update a Google Analytics custom metric on a property using a field mask to change only specified fields.

Instructions

Updates a CustomMetric on a property [HTTP PATCH] — updates the resource; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON GoogleAnalyticsAdminV1betaCustomMetric object accepting description, displayName, measurementUnit, name, parameterName, restrictedMetricType, scope; pass it via params or whole via body_file Siblings over the same resource: archive, create, get, list.

Input Schema

NameRequiredDescriptionDefault
nameYes[URL path segment] Identifier. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}
queryNoExtra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe.
paramsNoParameter map merged into the request; typed parameters win.
dry_runNoReturn the request that would be sent, without sending it.
body_fileNoRead the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON GoogleAnalyticsAdminV1betaCustomMetric object.
updateMaskNo[query parameter] Required. The list of fields to be updated. Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fiel
request_bodyNoRequest body of type GoogleAnalyticsAdminV1betaCustomMetric: pass it via `params` (merged into the built body) or whole via `body_file`.

Output Schema

NameRequiredDescriptionDefault
nameNo
scopeNo
descriptionNo
displayNameNo
parameterNameNo
measurementUnitNo
restrictedMetricTypeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / body_file / description
      Previous value: -"Read the request body from this file ('-' for stdin) instead of building one from the parameters."New value: +"Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON GoogleAnalyticsAdminV1betaCustomMetric object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type GoogleAnalyticsAdminV1betaCustomMetric: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "description": {
      +      "type": "string"
      +    },
      +    "displayName": {
      +      "type": "string"
      +    },
      +    "measurementUnit": {
      +      "enum": [
      +        "MEASUREMENT_UNIT_UNSPECIFIED",
      +        "STANDARD",
      +        "CURRENCY",
      +        "FEET",
      +        "METERS",
      +        "KILOMETERS",
      +        "MILES",
      +        "MILLISECONDS",
      +        "SECONDS",
      +        "MINUTES",
      +        "HOURS"
      +      ],
      +      "type": "string"
      +    },
      +    "name": {
      +      "type": "string"
      +    },
      +    "parameterName": {
      +      "type": "string"
      +    },
      +    "restrictedMetricType": {
      +      "items": {
      +        "enum": [
      +          "RESTRICTED_METRIC_TYPE_UNSPECIFIED",
      +          "COST_DATA",
      +          "REVENUE_DATA"
      +        ],
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "scope": {
      +      "enum": [
      +        "METRIC_SCOPE_UNSPECIFIED",
      +        "EVENT"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed5 schema fields changed
    • changedInput schema / properties / name / description
      Previous value: -"Identifier. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}"New value: +"[URL path segment] Identifier. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}"
    • addedInput schema / properties / name / pattern
      Added value: +"^properties/[^/]+/customMetrics/[^/]+$"
    • changedInput schema / properties / updateMask / description
      Previous value: -"Required. The list of fields to be updated. Omitted fields will not be updated. To replace the entire entity, use one path with the string \"*\" to match all fiel"New value: +"[query parameter] Required. The list of fields to be updated. Omitted fields will not be updated. To replace the entire entity, use one path with the string \"*\" to match all fiel"
    • addedInput schema / properties / updateMask / format
      Added value: +"google-fieldmask"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "description": {
      +      "type": "string"
      +    },
      +    "displayName": {
      +      "type": "string"
      +    },
      +    "measurementUnit": {
      +      "enum": [
      +        "MEASUREMENT_UNIT_UNSPECIFIED",
      +        "STANDARD",
      +        "CURRENCY",
      +        "FEET",
      +        "METERS",
      +        "KILOMETERS",
      +        "MILES",
      +        "MILLISECONDS",
      +        "SECONDS",
      +        "MINUTES",
      +        "HOURS"
      +      ],
      +      "type": "string"
      +    },
      +    "name": {
      +      "type": "string"
      +    },
      +    "parameterName": {
      +      "type": "string"
      +    },
      +    "restrictedMetricType": {
      +      "items": {
      +        "enum": [
      +          "RESTRICTED_METRIC_TYPE_UNSPECIFIED",
      +          "COST_DATA",
      +          "REVENUE_DATA"
      +        ],
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "scope": {
      +      "enum": [
      +        "METRIC_SCOPE_UNSPECIFIED",
      +        "EVENT"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does add real value: it discloses that the call is refused under --readonly safety profiles, describes the return (response resource as JSON), and explains the params vs body_file body-construction paths. It omits permission/OAuth scope requirements, idempotency, and partial-update semantics (which fields change / are left untouched), which are significant for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the action and method, which is good, but then crams body field enumeration, the params/body_file mechanism, and the sibling list into one dense run-on. The field list duplicates schema content and could be trimmed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists and the input schema is fully described, so the core is covered; the safety-profile refusal is a useful addition. However, for a mutation tool with no annotations and a required updateMask, the description should also flag permission requirements and the partial-update implication of updateMask.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents name, updateMask, query, params, dry_run, and body_file. The description still adds value by stating the body object type and the two ways to supply it (params merge vs whole body_file), though it redundantly re-enumerates body fields already in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (updates) and resource (CustomMetric on a property), and the HTTP method [HTTP PATCH]. It explicitly names the sibling operations over the same resource (archive, create, get, list), so an agent can place it precisely in the CRUD family without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It names the sibling tools but never states when to choose patch over update/create/archive, nor what prerequisites (e.g., updateMask, permissions) select it. Usage is implied by the PATCH verb and sibling list rather than spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools