Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(replay): trim full person properties from session-recording-get (#70578)

posthog[bot]ac70868213a8
diff --git a/products/replay/mcp/tools.yaml b/products/replay/mcp/tools.yaml
index e27d85b2ace4..0eecb9b0e7ad 100644
--- a/products/replay/mcp/tools.yaml
+++ b/products/replay/mcp/tools.yaml
@@ -62,18 +62,22 @@ tools:
title: Get session recording
description: >
Get a specific session recording by ID. Returns full recording metadata including duration, interaction
- counts, console log counts, person info, and viewing status. Session recordings are reachable from events,
- errors, and persons via the `$session_id` property on events. Any `$session_id` value from an event can be
- passed as the `id` parameter to this tool. Note: a `$session_id` on an event does not guarantee a recording
- exists — session replay may not be enabled for that project or session. A 404 means no recording was
- captured. If the user wants to understand what happened without watching the recording, check
- `vision-observations-list` for an existing Replay Vision AI summary, or run a summarizer scanner via
- `vision-scanners-scan-session` (see the investigating-replay skill; scanning is slow). If a recording is
- missing (404) or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query
- `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and
+ counts, console log counts, viewing status, and a compact person summary (id, name, distinct IDs). The
+ person's full property bag is not included — use `persons-retrieve` when you need a person's properties.
+ Session recordings are reachable from events, errors, and persons via the `$session_id` property on events.
+ Any `$session_id` value from an event can be passed as the `id` parameter to this tool. Note: a
+ `$session_id` on an event does not guarantee a recording exists — session replay may not be enabled for that
+ project or session. A 404 means no recording was captured. If the user wants to understand what happened
+ without watching the recording, check `vision-observations-list` for an existing Replay Vision AI summary,
+ or run a summarizer scanner via `vision-scanners-scan-session` (see the investigating-replay skill; scanning
+ is slow). If a recording is missing (404) or the user asks why recordings aren't being captured, diagnose
+ with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and
`$sdk_debug_recording_script_not_loaded` from the events table (filter by `$session_id` for a specific
session, or sample recent events for project-wide issues).
ui_app: session-recording
+ response:
+ exclude:
+ - person.properties
session-recording-playlist-create:
operation: session_recording_playlists_create
enabled: true
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index 3e0c7d41be42..1d102727d7fa 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -7293,7 +7293,7 @@
}
},
"session-recording-get": {
- "description": "Get a specific session recording by ID. Returns full recording metadata including duration, interaction counts, console log counts, person info, and viewing status. Session recordings are reachable from events, errors, and persons via the `$session_id` property on events. Any `$session_id` value from an event can be passed as the `id` parameter to this tool. Note: a `$session_id` on an event does not guarantee a recording exists — session replay may not be enabled for that project or session. A 404 means no recording was captured. If the user wants to understand what happened without watching the recording, check `vision-observations-list` for an existing Replay Vision AI summary, or run a summarizer scanner via `vision-scanners-scan-session` (see the investigating-replay skill; scanning is slow). If a recording is missing (404) or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from the events table (filter by `$session_id` for a specific session, or sample recent events for project-wide issues).",
+ "description": "Get a specific session recording by ID. Returns full recording metadata including duration, interaction counts, console log counts, viewing status, and a compact person summary (id, name, distinct IDs). The person's full property bag is not included — use `persons-retrieve` when you need a person's properties. Session recordings are reachable from events, errors, and persons via the `$session_id` property on events. Any `$session_id` value from an event can be passed as the `id` parameter to this tool. Note: a `$session_id` on an event does not guarantee a recording exists — session replay may not be enabled for that project or session. A 404 means no recording was captured. If the user wants to understand what happened without watching the recording, check `vision-observations-list` for an existing Replay Vision AI summary, or run a summarizer scanner via `vision-scanners-scan-session` (see the investigating-replay skill; scanning is slow). If a recording is missing (404) or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from the events table (filter by `$session_id` for a specific session, or sample recent events for project-wide issues).",
"category": "Session replays",
"feature": "replay",
"summary": "Get session recording",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 0ad4774bcb94..cd6efab22ba1 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -7785,7 +7785,7 @@
}
},
"session-recording-get": {
- "description": "Get a specific session recording by ID. Returns full recording metadata including duration, interaction counts, console log counts, person info, and viewing status. Session recordings are reachable from events, errors, and persons via the `$session_id` property on events. Any `$session_id` value from an event can be passed as the `id` parameter to this tool. Note: a `$session_id` on an event does not guarantee a recording exists — session replay may not be enabled for that project or session. A 404 means no recording was captured. If the user wants to understand what happened without watching the recording, check `vision-observations-list` for an existing Replay Vision AI summary, or run a summarizer scanner via `vision-scanners-scan-session` (see the investigating-replay skill; scanning is slow). If a recording is missing (404) or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from the events table (filter by `$session_id` for a specific session, or sample recent events for project-wide issues).",
+ "description": "Get a specific session recording by ID. Returns full recording metadata including duration, interaction counts, console log counts, viewing status, and a compact person summary (id, name, distinct IDs). The person's full property bag is not included — use `persons-retrieve` when you need a person's properties. Session recordings are reachable from events, errors, and persons via the `$session_id` property on events. Any `$session_id` value from an event can be passed as the `id` parameter to this tool. Note: a `$session_id` on an event does not guarantee a recording exists — session replay may not be enabled for that project or session. A 404 means no recording was captured. If the user wants to understand what happened without watching the recording, check `vision-observations-list` for an existing Replay Vision AI summary, or run a summarizer scanner via `vision-scanners-scan-session` (see the investigating-replay skill; scanning is slow). If a recording is missing (404) or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from the events table (filter by `$session_id` for a specific session, or sample recent events for project-wide issues).",
"category": "Session replays",
"feature": "replay",
"summary": "Get session recording",
diff --git a/services/mcp/src/tools/generated/replay.ts b/services/mcp/src/tools/generated/replay.ts
index cb0363b9fa7a..9ee3bf7be104 100644
--- a/services/mcp/src/tools/generated/replay.ts
+++ b/services/mcp/src/tools/generated/replay.ts
@@ -16,7 +16,7 @@ import {
} from '@/generated/replay/api'
import { withUiApp } from '@/resources/ui-apps'
import { createQueryWrapper } from '@/tools/query-wrapper-factory'
-import { withPostHogUrl, type WithPostHogUrl } from '@/tools/tool-utils'
+import { withPostHogUrl, omitResponseFields, type WithPostHogUrl } from '@/tools/tool-utils'
import type { Context, ToolBase, ZodObjectAny } from '@/tools/types'
const SessionRecordingBulkDeleteSchema = SessionRecordingsBulkDeleteCreateBody
@@ -72,7 +72,8 @@ const sessionRecordingGet = (): ToolBase<typeof SessionRecordingGetSchema, WithP
method: 'GET',
path: `/api/projects/${encodeURIComponent(String(projectId))}/session_recordings/${encodeURIComponent(String(params.id))}/`,
})
- return await withPostHogUrl(context, result, `/replay/${result.id}`)
+ const filtered = omitResponseFields(result, ['person.properties']) as typeof result
+ return await withPostHogUrl(context, filtered, `/replay/${filtered.id}`)
},
})