update_metric
Update a metric (goal). Requires mcp:write and the existing metric update policy. Type and winning direction cannot change after the metric is used.
Update a metric (goal). Requires mcp:write and the existing metric update policy. Type and winning direction cannot change after the metric is used.
Permissions
{
"scope": "mcp:read and mcp:write",
"role": "The existing entity create/update policy must allow this user; the mcp:write scope alone is insufficient.",
"plan": "The billing account must have the MCP entitlement. Writes also require a writable billing mode and applicable entity limits.",
"team": "The OAuth connection is approved for exactly one Team. Other team_id values cannot change the tenant."
}Input
{
"properties": {
"metric_id": {
"description": "Metric ID in the authenticated team",
"type": "integer"
},
"name": {
"description": "Optional metric name",
"maxLength": 255,
"type": "string"
},
"description": {
"description": "Optional description",
"type": "string"
},
"type": {
"description": "Optional metric type. Rejected when the metric is already used.",
"enum": [
"average-per-user",
"rate-per-user",
"average-per-session",
"rate-per-session"
],
"type": "string"
},
"winning_direction": {
"description": "Optional winning direction. Rejected when the metric is already used.",
"enum": [
"increasing",
"decreasing"
],
"type": "string"
}
},
"type": "object",
"required": [
"metric_id"
]
}Output
{
"type": "object",
"properties": {
"updated": {
"type": "boolean"
},
"found": {
"type": "boolean"
},
"data": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"project_id": {
"type": [
"integer",
"null"
]
},
"name": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"type": {
"type": [
"string",
"null"
],
"enum": [
"average-per-user",
"rate-per-user",
"average-per-session",
"rate-per-session",
null
]
},
"winning_direction": {
"type": [
"string",
"null"
],
"enum": [
"increasing",
"decreasing",
null
]
}
},
"required": [
"id",
"project_id",
"name",
"description",
"type",
"winning_direction"
]
},
{
"type": "null"
}
]
}
},
"required": [
"updated",
"found",
"data"
]
}Examples
Request arguments
{
"metric_id": 101,
"name": "Checkout conversion"
}Result
{
"updated": true,
"found": true,
"data": {
"id": 101,
"project_id": 1,
"name": "Checkout conversion",
"description": null,
"type": "average-per-user",
"winning_direction": "increasing"
}
}Request arguments
{
"metric_id": 101,
"name": "Checkout conversion"
}Result
{
"updated": false,
"found": false,
"data": null
}Errors
[
{
"status": 401,
"description": "Missing, expired, or revoked OAuth access token."
},
{
"status": 403,
"description": "Missing MCP scope, team membership, plan entitlement, or user permission."
},
{
"status": 404,
"description": "The MCP server is disabled."
},
{
"status": 429,
"description": "Rate limited; honor Retry-After before retrying."
},
{
"description": "Tool execution or validation failures are MCP error results. Inspect isError; a successful HTTP status alone does not indicate a successful tool call."
}
]An expired or revoked OAuth connection cannot connect. A missing scope, role, feature entitlement, or team access prevents the operation. See MCP setup.