Draft an Analytics custom metric
draft_ga4_custom_metricDraft registering, changing or archiving a GA4 custom metric, returning a PREVIEW.
Registering makes a numeric event parameter reportable as a metric. The draft refuses a parameter that is already registered, a taken display name and a full property (see list_ga4_custom_definitions), and the preview warns that GA4 fills the metric only from now on. Update changes display_name, description, measurement_unit or restricted_metric_type; archive removes it from reports, cannot be undone and needs a double confirmation. Nothing changes until confirm_and_apply applies it. GA4 Admin API (customMetrics).
Google Analytics Data API: https://developers.google.com/analytics/devguides/reporting/data/v1 and Admin API: https://developers.google.com/analytics/devguides/config/admin/v1
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "draft_ga4_custom_metric"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | "create" (default), "update" or "archive". | create |
| description | No | Up to 150 characters. On update, "" clears it. | |
| property_id | No | Numeric GA4 property ID, with or without the "properties/" prefix. If empty, uses the default from config. | |
| display_name | No | Name shown in GA4; defaults to parameter_name on create. | |
| custom_metric | No | Resource name, instead of parameter_name, for update or archive. | |
| parameter_name | No | The numeric event parameter exactly as sent, e.g. "discount_amount". Required for create; identifies the metric for update and archive. | |
| measurement_unit | No | STANDARD (default on create), CURRENCY, FEET, METERS, KILOMETERS, MILES, MILLISECONDS, SECONDS, MINUTES or HOURS. | |
| restricted_metric_type | No | For CURRENCY metrics, required: ["COST_DATA"] or ["REVENUE_DATA"] (or both). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||