Skip to main content
Glama

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.

Input Schema

NameRequiredDescriptionDefault
hostNoPostHog host (default https://us.posthog.com)
queryYesHogQL/SQL query (e.g. select count() from events)
api_keyYesPostHog Personal API key
project_idNoPostHog project id (can be a saved default)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It implies a read-style query but never states whether the operation is read-only, what permissions the Personal API key needs, or whether there are rate limits or result caps. For a tool with zero annotation coverage this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no wasted words. It is efficient, though its brevity contributes to the missing behavioral and usage context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema and no annotations, so the description should compensate. It does note the scope (events), which is a useful constraint for HogQL, but it omits auth expectations and result characteristics for a 4-parameter tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so host, query, api_key, and project_id are already documented in the schema. The description adds no syntax or format guidance (e.g. HogQL dialect limits, project_id default behavior) beyond what the schema provides; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Run) and resource (ad-hoc HogQL/SQL query) scoped to a PostHog project's events. It is distinguishable from the sibling posthog_list_* tools, which are predefined listers, though it does not name them explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The word 'ad-hoc' hints that this is for custom, one-off queries rather than the predefined list tools, but there is no explicit when-to-use, when-not-to-use, or named alternative. Usage is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools