amp_get_retention
Pack: amplitude · Endpoint: https://gateway.pipeworx.io/amplitude/mcp
Get user retention metrics for a cohort over time. Returns retention percentages by time period (e.g., day 1, day 7, day 30).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
_apiKey | string | yes | Amplitude API key |
_secretKey | string | yes | Amplitude secret key |
start | string | yes | Start date (YYYYMMDD) |
end | string | yes | End date (YYYYMMDD) |
re | string | no | Retention type: “rolling” or “bracket” (default “rolling”) |
Example call
Arguments
{
"_apiKey": "your-amplitude-api-key",
"_secretKey": "your-amplitude-secret-key",
"start": "20240101",
"end": "20240228"
}
curl
curl -X POST https://gateway.pipeworx.io/amplitude/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"amp_get_retention","arguments":{"_apiKey":"your-amplitude-api-key","_secretKey":"your-amplitude-secret-key","start":"20240101","end":"20240228"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('amp_get_retention', {
"_apiKey": "your-amplitude-api-key",
"_secretKey": "your-amplitude-secret-key",
"start": "20240101",
"end": "20240228"
});
More examples
{
"_apiKey": "your-amplitude-api-key",
"_secretKey": "your-amplitude-secret-key",
"start": "20240101",
"end": "20240228",
"re": "bracket"
}
Response shape
| Field | Type | Description |
|---|---|---|
series | array | Retention metrics by cohort |
Full JSON Schema
{
"type": "object",
"properties": {
"series": {
"type": "array",
"items": {
"type": "object",
"properties": {
"cohort_date": {
"type": "string",
"description": "Cohort start date"
},
"retention": {
"type": "array",
"items": {
"type": "object",
"properties": {
"date": {
"type": "string",
"description": "Retention period date"
},
"retention_rate": {
"type": "number",
"description": "Percentage retained (0-100)"
}
}
},
"description": "Retention rates by period"
}
}
},
"description": "Retention metrics by cohort"
}
}
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"amplitude": {
"url": "https://gateway.pipeworx.io/amplitude/mcp"
}
}
}
See Getting Started for client-specific install steps.