Eppo ACTION
Upsert Metric
Create or update a metric in Eppo. Omit
metricId to create a new metric; provide metricId to update an existing one. Use this when the user wants to define a new KPI/metric or update the definition of an existing metric. Use List Metrics to find the numeric metricId for an update and to look up the entityId from existing metrics. entityId is required — find it in the entity_id field of any existing metric returned by List Metrics. The minimumDetectableEffect is a decimal representing the smallest meaningful relative change (e.g. 0.05 for 5%). Provide exactly one metric definition: numerator (standard or ratio metrics), percentile, or funnelAggregation. For ratio metrics, also provide denominator. Set denominator to the JSON literal null for non-ratio metrics. IMPORTANT: metric_event_measure_id is a data-source ID from your Eppo data pipeline configuration — obtain it from your Eppo workspace's data integration settings. It is NOT the same as a metric ID or aggregation ID. The Eppo API requires the full numerator/percentile/funnel definition even for metadata-only updates. See the documentation - Create Metric and See the documentation - Update Metric- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Eppo account once, then configure and run Upsert Metric from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "eppo-upsert-metric",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
eppo: { authProvisionId: "apn_xxxxxxx" },
metricId: 10,
entityId: 10,
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "eppo-upsert-metric",
"configured_props": {
"eppo": { "authProvisionId": "apn_xxxxxxx" },
"metricId": 10,
"entityId": 10
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "eppo",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "eppo-upsert-metric",
arguments: {
metricId: 10,
entityId: 10,
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
metricId Metric ID | integer | The numeric ID of an existing metric to update. Omit this field to create a new metric. Use List Metrics to discover metric IDs. Optional |
entityId Entity ID | integer | The numeric entity type ID this metric measures (e.g. user, session). Use List Metrics to find the entity_id from any existing metric — all metrics in the same workspace typically share the same entity ID. Required |
name Name | string | The display name for the metric. Required |
description Description | string | A description of what this metric measures. Required |
type Type | string | The type of metric. Optional |
displayStyle Display Style | string | Whether to format the metric as a percent in the Eppo UI. Valid values: decimal or percent. Required |
minimumDetectableEffect Minimum Detectable Effect | string | The smallest relative change considered meaningful, as a decimal. Example: 0.05 for 5%. Used to calculate required sample sizes. Required |
numerator Numerator | string | JSON object for the numerator aggregation. Required for standard and ratio metrics; omit or set to null for funnel and percentile metrics. Requires metric_event_measure_id and operation. Valid operations: count, sum, countDistinct, timeTo, retention, conversion, threshold, countDistinctValue, lastValue, firstValue. filters is an array of objects with metric_event_dimension_id, operation (EQUALS or DOES_NOT_EQUAL), and values. Set retention_threshold_days when operation is retention; set conversion_threshold_days when operation is conversion; set threshold_metric_settings when operation is threshold. Example: {"metric_event_measure_id": 123, "operation": "count", "filters": []}. Optional |
denominator Denominator | string | JSON object for the denominator aggregation on ratio metrics. Use the same shape as numerator. Set to the JSON literal null for non-ratio metrics. Example: {"metric_event_measure_id": 456, "operation": "count", "filters": []}. Optional |
percentile Percentile | string | JSON object for percentile metrics. Requires metric_event_measure_id, filters (array), and percentile_value (0.01–0.99). Example: {"metric_event_measure_id": 123, "filters": [], "percentile_value": 0.95}. Optional |
funnelAggregation Funnel Aggregation | string | JSON object for funnel metrics. Requires funnel_steps, an ordered array of objects each with metric_event_measure_id. Optional fields: conversion_time_from (experimentAssignment or firstEvent), conversion_time_value, and conversion_time_units (days, hours, minutes, or seconds). Example: {"funnel_steps": [{"metric_event_measure_id": 123}, {"metric_event_measure_id": 456}], "conversion_time_value": 7, "conversion_time_units": "days"}. Optional |
desiredChange Desired Change | string | The desired direction of change. Use increase if higher values are better, or decrease if lower values are better. If omitted, the metric inherits the desired change from the underlying fact. Optional |
teamId Team ID | integer | The numeric ID of the team to assign this metric to. Omit to leave the team assignment unchanged on update. Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- eppo-upsert-metric
- Version
- 0.0.2
- App
- Eppo
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗