posthog_query
Run ad-hoc HogQL/SQL queries against a PostHog project's events to inspect and analyze event data.
Instructions
Run an ad-hoc HogQL (SQL) query against a PostHog project's events.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"api_key": "<api_key>",
"query": "<query>"
},
"name": "posthog_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | PostHog host (default https://us.posthog.com) | |
| query | Yes | HogQL/SQL query (e.g. select count() from events) | |
| api_key | Yes | PostHog Personal API key | |
| project_id | No | PostHog project id (can be a saved default) |