exploring-mcp-tool-original-user-motive

Reconstructs session goals from MCP tool-call telemetry and publishes a clustered taxonomy as a PostHog notebook.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill exploring-mcp-tool-original-user-motive
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: exploring-mcp-tool-original-user-motive
Source: https://github.com/PostHog/posthog-foss/tree/main/products/mcp_analytics/skills/exploring-mcp-tool-original-user-motive
Command: npx skills add https://github.com/PostHog/posthog-foss --skill exploring-mcp-tool-original-user-motive

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openai, numpy, pydantic, and includes scripts (resource) and references (resource) components.

What problem does it solve?

MCP telemetry records the action an agent took per call ($mcp_intent), but never the goal the user started with, so there is no way to answer "why do people use this tool?" from raw events. This Skill reconstructs each session's starting intention from its opening tool calls, clusters those goals into a named taxonomy, and publishes the result as a shareable PostHog notebook.

Core Features & Use Cases

  • Corpus construction with skew control: HogQL queries build a per-session corpus of opening tool calls with caller and org attribution, filtering out setup wizards, staff traffic, and other automated programs that would otherwise dominate the taxonomy.
  • Facet extraction and canonicalization: Bundled scripts extract per-session facets with gpt-4.1-mini, collapse freely-worded labels onto a shared vocabulary via embeddings, and audit near-duplicate intentions by cosine similarity.
  • Notebook publication recipe: Step-by-step guidance assembles a multi-cell PostHog notebook (SQL corpus, Python facet frames, per-org joins, concentration checks) with privacy safeguards that keep raw customer intent text out of shareable cells.
  • Use Case: An analyst asks "what are users actually trying to do with workflows-create?" The Skill pulls 90 days of sessions, labels each session's starting goal, clusters them into themes like maintenance and recurring reporting, and publishes a notebook showing that a fifth of a create tool's usage is actually debugging and repair.

Quick Start

Ask the agent to build a starting-point taxonomy for a specific MCP tool, for example: "Analyze why people use the workflows-create MCP tool over the last 90 days and publish the goal taxonomy as a PostHog notebook."

Frequently Asked Questions about exploring-mcp-tool-original-user-motive

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find out why users call a specific MCP tool?

Build a corpus of sessions that called the tool, read each session's opening tool calls to recover the starting goal, then cluster those goals into a taxonomy. This Skill provides the HogQL queries, extraction scripts, and notebook recipe to do exactly that and publish the result.

What is the difference between $mcp_intent and the user's actual goal?

$mcp_intent records the action an agent was taking at the moment of a call, such as creating a notebook. The user's goal is the upstream reason, like investigating a conversion drop, which is never written to any property and must be reconstructed from the session's opening calls.

Should I use the extract_facets.py script or label sessions manually?

Read the corpus yourself for the goal field, because per-session API calls cannot converge on shared wording and describe mechanics rather than reasons. The script is acceptable for mechanical facets like data_touched, followed by canonicalize_intentions.py to collapse label drift.

How do I handle automated traffic like setup wizards in MCP analytics?

Split the corpus on caller identity, never on intent keywords. Check $mcp_client_user_agent, $mcp_consumer, $mcp_vendor_client, and $mcp_client_name in that order, since the wizard identifies itself only in the user agent and keyword filters both miss and misflag sessions.

Why does canonicalize_intentions.py need to run after scripted extraction?

Each session is extracted by an independent API call that cannot see other sessions' labels, so 500 sessions can return 487 distinct labels. The script shows all labels to the model at once to propose a canonical vocabulary, then assigns labels by embedding similarity.

Can this Skill be used by PostHog customers or run unattended?

No. It is an internal analyst tool that queries cross-organization telemetry and reads customer-authored intent text, so it must run attended by PostHog staff. It must not be seeded into customer teams or named in MCP tool descriptions.