Amplitude ACTION
Get User Activity
Fetch the event stream for a single user by their numeric Amplitude ID from the Amplitude Dashboard REST API. Each returned event defaults to just event_type and event_time; pass
fields to also get e.g. event_properties, user_properties, uuid, session_id, amplitude_id, device_id (event objects can carry many properties, so these stay opt-in). Amplitude's API caps each request at 1000 events with no cursor; this tool pages offset forward automatically to collect up to limit events (set it above 1000, up to 5000, to fetch more than one page). Use Search Users first to resolve the Amplitude ID. Example: call with user=12345678, limit=50 -> returns {events: [{event_type: "Purchase", event_time: "2024-08-05 14:22:10"}, ...], userData: {...}, truncated: false} (truncated: true means more events likely exist beyond what was returned — raise limit/offset to fetch further). See the documentation.- Action
- Read only
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Amplitude account once, then configure and run Get User Activity 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: "amplitude-get-user-activity",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
amplitude: { authProvisionId: "apn_xxxxxxx" },
user: 10,
offset: 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": "amplitude-get-user-activity",
"configured_props": {
"amplitude": { "authProvisionId": "apn_xxxxxxx" },
"user": 10,
"offset": 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": "amplitude",
},
},
},
)
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: "amplitude-get-user-activity",
arguments: {
user: 10,
offset: 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 |
|---|---|---|
user User | integer | The numeric Amplitude ID of the user (the user param). Example: 12345678. Use Search Users to resolve this from an email or User ID. Required |
offset Offset | integer | Zero-indexed starting offset into the event stream (the offset param). Min 0. Amplitude documents no upper bound — raise this to page further back into an already-fetched user's history. Optional |
direction Direction | string | Chronological direction (the direction param). One of earliest, latest. Defaults to latest. Optional |
limit Limit | integer | Maximum number of events to return in total (the limit param, requested in pages of up to 1000). Min 1, max 5000. Defaults to 1000. Set above 1000 to fetch more than one page; check the response's truncated flag to see if more events exist beyond what was returned. Optional |
fields Fields | string[] | Field names to return for each event (event_type and event_time are always included). Also available: event_properties, user_properties, uuid, session_id, amplitude_id, device_id. Pass only what you need to keep responses small. 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
- amplitude-get-user-activity
- Version
- 0.0.2
- App
- Amplitude
- Authentication
- API key
- Read-only
- Yes
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗