PostHog tools
Look up PostHog's read-only tools, selectors, inputs, and examples for agent steps and tool steps.
This reference lists the shipped PostHog tool catalog. See the PostHog overview for authentication and project boundaries.
Tool catalog
All tools require the read access configured in the personal API key recipe.
Tools
execute-sqlExecute a read-only HogQL query against PostHog data.
readSensitiveParameters
connectionIdstringOptional id of a data warehouse connection (e.g. Postgres, MySQL, Snowflake, Redshift). When set, the query runs live against that source instead of the ClickHouse catalog, and may only reference that source's tables. Discover connection ids with external-data-sources-connections-list, then list a connection's tables by running `SELECT table_name FROM system.information_schema.tables` with that connectionId set.
querystringRequiredThe final SQL query to be executed.
Minimum length 1.
sendRawQuerybooleanSend `query` to the connection verbatim instead of compiling it from HogQL first. Use this for SQL only that connection's own engine understands, such as vendor-specific functions. Requires connectionId, and works only on a pure direct connection (access_method 'direct'), not on a synced source with live queries enabled. The connection is read-only and accepts a single statement.
truncatebooleanWhether to truncate large blob/JSON values in results. Defaults to true. Set to false when you need full untruncated results (e.g., for dumping to a file).
Default true.
read-data-schemaRead the available PostHog event, entity, and property schema.
readParameters
queryobject (one of 7 shapes)RequiredThe data schema query to execute.
Show 7 attributesHide 7 attributes
kindconstant "events" | constant "event_properties" | constant "entity_properties" | constant "action_properties" | constant "entity_property_values" | constant "event_property_values" | constant "action_property_values"ConditionallimitintegerConditionalNumber of events to return per page.
Minimum 1. Maximum 500. Default 500.
offsetintegerConditionalNumber of events to skip for pagination.
Minimum 0. Maximum 9,007,199,254,740,991. Default 0.
event_namestringConditionalThe name of the event that you want to retrieve properties for.
entitystringConditionalThe entity to read: `person`, `session` for the columns of the `sessions` table, or a group type name. The plural form of any of these is accepted too.
action_idintegerConditionalThe ID of the action that you want to retrieve properties for.
Minimum -9,007,199,254,740,991. Maximum 9,007,199,254,740,991.
property_namestringConditionalVerified property name of an entity.
insights-listList saved insights in the current PostHog project.
readParameters
created_bystringJSON-encoded array of user IDs. Only returns insights whose `created_by` is in the list, e.g. `[1,42]`.
created_date_fromstringFilter by `created_at > created_date_from`. Accepts absolute or relative dates.
created_date_tostringFilter by `created_at < created_date_to`. Accepts absolute or relative dates.
dashboardsstringJSON-encoded array of dashboard IDs. Returns insights attached to every listed dashboard (AND).
date_fromstringFilter by `last_modified_at > date_from`. Accepts absolute dates (`2025-04-23`) or relative strings (`-7d`, `-1m`).
date_tostringFilter by `last_modified_at < date_to`. Accepts absolute dates or relative strings.
favoritedbooleanInclude this parameter (any value) to restrict results to insights marked as favorited.
include_dashboardsbooleanOpt in to receiving the deprecated `dashboards` field in insight payloads. Once opt-in enforcement is enabled, API-token callers stop receiving it by default; use `dashboard_tiles` instead.
insightstringRestrict to a single insight type. `JSON` matches non-wrapper query insights; `SQL` matches HogQL queries.
Possible values: FUNNELS, JOURNEYS, JSON, LIFECYCLE, PATHS, RETENTION, SQL, STICKINESS, TRENDS
last_viewed_date_fromstringFilter by `last_viewed_at > last_viewed_date_from`. Accepts absolute or relative dates.
last_viewed_date_tostringFilter by `last_viewed_at < last_viewed_date_to`. Accepts absolute or relative dates.
limitnumberNumber of results to return per page.
offsetnumberThe initial index from which to return the results.
savedbooleanWhen truthy, restricts results to insights that are saved (or attached to a visible dashboard). When falsy, only unsaved insights.
searchstringSearch term matched across name, derived_name, description, and tag names. Returns exact (case-insensitive substring) matches only; if no exact match exists, returns similar (fuzzy trigram) matches instead. Each result's `search_match_type` is `exact` or `similar`.
short_idstringtagsstringJSON-encoded array of tag names. Returns insights with any of the listed tags.
userbooleanInclude this parameter (any value) to restrict results to insights created by the authenticated user.
insight-getRetrieve a saved insight definition by numeric id or short id.
readParameters
filters_overridestring | objectObject (or pre-encoded JSON string) to override the insight's filters for this request only (not persisted). Top-level keys replace; nested values are not deep-merged: pass the complete value for any key you override. Accepts the same keys as the dashboard filters schema (e.g., `date_from`, `date_to`, `properties`). Ignored when accessed via a sharing token.
idnumber | stringRequiredNumeric primary key or 8-character `short_id` (for example `AaVQ8Ijw`) identifying the insight.
include_dashboardsbooleanOpt in to receiving the deprecated `dashboards` field in insight payloads. Once opt-in enforcement is enabled, API-token callers stop receiving it by default; use `dashboard_tiles` instead.
variables_overridestring | objectObject (or pre-encoded JSON string) to override the insight's HogQL variables for this request only (not persisted). Format: {"<variable_id>": {"code_name": "<code_name>", "variableId": "<variable_id>", "value": <new_value>}}. Each entry must include `code_name`: partial entries are silently dropped. The simplest workflow is to call `insight-get` first, copy the matching entry from the response, and mutate `value`. Top-level keys replace; nested values are not deep-merged. Ignored when accessed via a sharing token.
insight-queryRun a saved insight and return its query results.
readSensitiveParameters
filters_overridestring | objectObject (or pre-encoded JSON string) to override the insight's filters for this run only (not persisted). Top-level keys replace; nested values are not deep-merged: pass the complete value for any key you override. Accepts the same keys as the dashboard filters schema (e.g., `date_from`, `date_to`, `properties`). Ignored when accessed via a sharing token.
insightIdstring | numberRequiredThe insight to run: its numeric `id` or 8-character `short_id`.
output_formatstringOutput format. "optimized" returns a human-readable summary from server-side formatters (recommended for analysis). "json" returns the raw query results as JSON.
Possible values: optimized, json
Default "optimized".
variables_overridestring | objectObject (or pre-encoded JSON string) to override the insight's HogQL variables for this run only (not persisted). Format: {"<variable_id>": {"code_name": "<code_name>", "variableId": "<variable_id>", "value": <new_value>}}. Each entry must include `code_name`: partial entries are silently dropped. The simplest workflow is to call `insight-get` first, copy the matching entry from the response's query variables, and mutate `value`. Top-level keys replace; nested values are not deep-merged. Ignored when accessed via a sharing token.
List dashboards in the current PostHog project.
readParameters
exclude_generatedbooleanOptional. Exclude dashboards that PostHog generated.
folderstringOptional. Return only dashboards filed directly in this project-tree folder, e.g. 'Unfiled/Dashboards'. An empty string matches dashboards at the project root. Nested sub-folders are not included.
limitnumberNumber of results to return per page.
offsetnumberThe initial index from which to return the results.
pinnedbooleanOptional. Return only pinned dashboards.
searchstringOptional. Match against dashboard `name`, `description`, and tag names. Returns exact (case-insensitive substring) matches only; if no exact match exists, returns similar (fuzzy trigram: typos, transpositions, prefix-as-you-type) matches instead. Results are then ordered by relevance, then pinned status, then name; each result's `search_match_type` is `exact` or `similar`. When omitted, dashboards are ordered by pinned status then alphabetical name. Capped at 200 characters; longer queries return a 400 error.
dashboard-getRetrieve a dashboard and its tiles by id.
readParameters
filters_overridestring | objectObject (or pre-encoded JSON string) to override dashboard filters for this request only (not persisted). Top-level keys replace; nested values are not deep-merged: pass the complete value for any key you override. Accepts the same keys as the dashboard filters schema (e.g., `date_from`, `date_to`, `properties`). Ignored when accessed via a sharing token.
idnumberRequiredA unique integer value identifying this dashboard.
include_dashboardsbooleanOpt in to receiving the deprecated `dashboards` field in insight payloads. Once opt-in enforcement is enabled, API-token callers stop receiving it by default; use `dashboard_tiles` instead.
variables_overridestring | objectObject (or pre-encoded JSON string) to override dashboard variables for this request only (not persisted). Format: {"<variable_id>": {"code_name": "<code_name>", "variableId": "<variable_id>", "value": <new_value>}}. Each entry must include `code_name`: partial entries are silently dropped. The simplest workflow is to call `dashboard-get` first, copy the matching entry from the response, and mutate `value`. Top-level keys replace; nested values are not deep-merged. Ignored when accessed via a sharing token.
Run all insights on a dashboard and return their results.
readSensitiveParameters
filters_overridestring | objectObject (or pre-encoded JSON string) to override dashboard filters for this request only (not persisted). Top-level keys replace; nested values are not deep-merged: pass the complete value for any key you override. Accepts the same keys as the dashboard filters schema (e.g., `date_from`, `date_to`, `properties`). Ignored when accessed via a sharing token.
idnumberRequiredA unique integer value identifying this dashboard.
output_formatstring'optimized' (default) returns LLM-friendly formatted text per insight. 'json' returns the raw query result objects.
Possible values: json, optimized
refreshstringCache behavior. 'force_cache' (default) serves from cache even if stale. 'blocking' uses cache if fresh, otherwise recalculates. 'force_blocking' always recalculates.
Possible values: blocking, force_blocking, force_cache
variables_overridestring | objectObject (or pre-encoded JSON string) to override dashboard variables for this request only (not persisted). Format: {"<variable_id>": {"code_name": "<code_name>", "variableId": "<variable_id>", "value": <new_value>}}. Each entry must include `code_name`: partial entries are silently dropped. The simplest workflow is to call `dashboard-get` first, copy the matching entry from the response, and mutate `value`. Top-level keys replace; nested values are not deep-merged. Ignored when accessed via a sharing token.
List and aggregate error tracking issues.
readSensitiveParameters
assigneeobject | nullFilter by issue assignee. Omit to include all assignees.
Show 2 attributesHide 2 attributes
idstring | numberRequiredUser ID or role UUID to filter by.
typestringRequiredAssignee target type: user or role. * `user` - user * `role` - role
Possible values: user, role
dateRangeobjectDate range for issue aggregates. Defaults to the last 7 days.
Show 2 attributesHide 2 attributes
date_fromstringStart of the date range as an ISO timestamp or relative date such as -7d. Defaults to -7d.
date_tostring | nullEnd of the date range as an ISO timestamp or relative date. Defaults to now when omitted.
filePathstringSearch stack-frame source/file path text.
Maximum length 1,000.
filterGrouparray of objectAdvanced flat AND property filters. Prefer typed shortcut fields when they fit. HogQL filters are rejected.
Show 4 attributesHide 4 attributes
keystringRequiredKey of the property you're filtering on. For example `email` or `$current_url`
operatorstring | string | nullDefault "exact".
typestring | stringDefault "event".
valuestring | number | boolean | array of string | numberRequiredValue of your filter. For example `test@example.com` or `https://example.com/test/`. Can be an array for an OR query, like `["test@example.com","ok@example.com"]`
filterTestAccountsbooleanWhen true, exclude internal/test account data from results. Defaults to true.
Default true.
fingerprintstring | array of stringFilter by exact exception fingerprint hash, not fuzzy search.
librarystring | array of stringFilter by SDK/library value from event $lib, for example posthog-js.
limitnumberPage size.
Minimum 1. Maximum 100. Default 25.
offsetnumberPagination offset.
Minimum 0. Default 0.
orderBystringField used to sort issues. Defaults to occurrences. * `last_seen` - last_seen * `first_seen` - first_seen * `occurrences` - occurrences * `users` - users * `sessions` - sessions
Possible values: last_seen, first_seen, occurrences, users, sessions
Default "occurrences".
orderDirectionstringSort direction. Defaults to DESC. * `ASC` - ASC * `DESC` - DESC
Possible values: ASC, DESC
Default "DESC".
personIdstringFilter by exact PostHog person UUID.
releasestringFilter by exact release ID, version, or git commit ID captured in $exception_releases.
Maximum length 500.
searchQuerystringFree-text search across exception types, values, stack frames, and email fields.
Maximum length 500.
statusstringFilter by issue status. Defaults to active. * `archived` - archived * `active` - active * `resolved` - resolved * `pending_release` - pending_release * `suppressed` - suppressed * `all` - all
Possible values: archived, active, resolved, pending_release, suppressed, all
Default "active".
urlstringFilter by current URL substring.
Maximum length 1,000.
userstringSearch user/email text.
Maximum length 500.
volumeResolutionnumberNumber of volume buckets. Defaults to 0 for compact aggregate counts.
Minimum 0. Maximum 200. Default 0.
Retrieve details and impact for an error tracking issue.
readSensitiveParameters
dateRangeobjectDate range for issue impact and latest-event metadata. Defaults to the last 7 days.
Show 2 attributesHide 2 attributes
date_fromstringStart of the date range as an ISO timestamp or relative date such as -7d. Defaults to -7d.
date_tostring | nullEnd of the date range as an ISO timestamp or relative date. Defaults to now when omitted.
filterTestAccountsbooleanWhen true, exclude internal/test account data from results. Defaults to true.
Default true.
includeSparklinebooleanSet true to include a compact numeric occurrence sparkline. Defaults to false.
Default false.
issueIdstringRequiredError tracking issue ID.
volumeResolutionnumberVolume buckets. Maximum 200.
Minimum 0. Maximum 200. Default 0.
List feature flags in the current PostHog project.
readParameters
activestringPossible values: STALE, false, true
archivedstringFilter by archived state. When omitted, archived flags are excluded.
Possible values: false, true
created_by_idstringFilter by the user(s) who created the feature flag. Accepts a single user ID, or a JSON-encoded / comma-separated list of user IDs to match any of them.
eligible_for_experimentstringWhen 'true', only return flags that can back an experiment: multivariate with 2-20 variants. Any other value is ignored.
Possible values: true
evaluation_runtimestringFilter feature flags by their evaluation runtime.
Possible values: all, client, server
excluded_propertiesstringJSON-encoded list of feature flag keys to exclude from the results.
excluded_tagsstringJSON-encoded list of tag names to exclude. Flags carrying any of these tags are filtered out.
has_evaluation_contextsstringFilter feature flags by presence of evaluation contexts. 'true' returns only flags with at least one evaluation context, 'false' returns only flags without.
Possible values: false, true
keystringFilter by exact feature flag key match. Case insensitive.
limitnumberNumber of results to return per page.
offsetnumberThe initial index from which to return the results.
searchstringSearch by feature flag key or name (case-insensitive). Use this to find the flag ID for get/update/delete tools.
tagsstringJSON-encoded list of tag names to filter feature flags by.
typestringPossible values: boolean, experiment, multivariant, remote_config
Retrieve a feature flag definition by id.
readParameters
idnumberRequiredA unique integer value identifying this feature flag.
experiment-listList experiments in the current PostHog project.
readParameters
archivedbooleanFilter by archived state. Defaults to non-archived experiments only.
created_by_idstringFilter to experiments created by the given user(s). Accepts a single user ID, or a JSON-encoded / comma-separated list of user IDs to match any of them.
eventstringFilter to experiments whose metrics reference this event name. Matches events used directly in metric queries as well as events behind any actions those metrics reference.
excluded_tagsstringJSON-encoded list of tag names. Excludes experiments carrying any of the given tags, even when they also carry non-excluded tags.
feature_flag_idnumberFilter to experiments linked to the given feature flag ID.
limitnumberNumber of results to return per page.
offsetnumberThe initial index from which to return the results.
orderstringField to order by. Prefix with '-' for descending. Allowlisted fields include name, created_at, updated_at, start_date, end_date, duration, and status.
prompt_namestringFilter to experiments created from an LLM prompt with this name. Matches experiments whose parameters.prompt_metadata.name equals the given value.
searchstringFree-text search applied to the experiment name (case-insensitive).
statusstringFilter by experiment status. Values: "draft" (not yet launched), "running" (launched, flag active), "paused" (launched, flag deactivated: mutually exclusive with running), "exposure_frozen" (launched, enrollment frozen to the already-exposed cohort while metrics keep flowing), "stopped" or "complete" (both mean ended), "all" (no filter). Defaults to all non-archived experiments.
Possible values: all, complete, draft, exposure_frozen, paused, running, stopped
tagsstringJSON-encoded list of tag names. Returns experiments carrying at least one of the given tags, e.g. `["growth", "checkout"]`.
experiment-getRetrieve an experiment by id.
readParameters
idnumberRequiredA unique integer value identifying this experiment.
Retrieve comprehensive results for an experiment.
readSensitiveParameters
idnumberRequiredThe ID of the experiment to get comprehensive results for
refreshbooleanForce refresh of results instead of using cached values. Defaults to false.
Default false.
surveys-get-allList surveys in the current PostHog project.
readParameters
archivedbooleancreated_bynumberFilter surveys by the ID of the user who created them.
idsarray of stringMultiple values may be separated by commas.
limitnumberNumber of results to return per page.
offsetnumberThe initial index from which to return the results.
searchstringMatch against survey `name` and `description`. Returns exact (case-insensitive substring) matches only; if no exact match exists, returns similar (fuzzy trigram: typos, prefix-as-you-type) matches instead. Each result's `search_match_type` is `exact` or `similar`.
statusstringFilter surveys by their current status. * `draft` - Draft * `running` - Running * `complete` - Complete
Possible values: complete, draft, running
typestring* `popover` - popover * `widget` - widget * `external_survey` - external survey * `api` - api
Possible values: api, external_survey, popover, widget
survey-getRetrieve a survey by id.
readParameters
idstringRequiredA UUID string identifying this survey.
survey-statsRetrieve response statistics for a survey.
readSensitiveParameters
date_fromstring (date-time)Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z)
date_tostring (date-time)Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z)
idstringRequiredA UUID string identifying this survey.
include_per_question_statsbooleanWhen true, also return per-question response counts and answer distributions. Adds one extra HogQL query per question, so leave off unless you need the breakdown.
docs-searchSearch the PostHog documentation.
readParameters
querystringRequiredNatural-language description of what to find in the PostHog documentation. Inkeep performs hybrid (semantic + full-text) RAG, so phrase the query the way a user would ask the question.