Repository navigation
Conversation
SDK performance: posthog-pythonBenchmarks completed. No changes flagged for review. Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate. View all results
Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals. Each shard uses its own runner; compare Before PR against With PR within a row, not across shards. Compared 102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in |
💡 Motivation and Context
collect_listed_toolscaches each tool's description and category fromtools/list, and$mcp_tool_callreads them from that cache. When a later listing serves a tool with an empty or missing description, or without_meta.category, theifskips the write and the cache keeps the earlier value, so tool call events keep reporting text the server no longer advertises.The spec defines
$mcp_tool_descriptionand$mcp_tool_categoryas "known" values ("set whenever the SDK can determine the value") and asks for them to come from the registered tools "rather than only from an earlier listing". It doesn't spell out the empty case, so this is my reading of its intent: a listing that clears the value should clear it in the event too.This PR only covers a tool that is still listed. A tool that disappears from a listing keeps its cached values, and Python reading only from the listing cache (rather than the registry) is a broader gap. I left both out on purpose to keep this change small, and I'm happy to open an issue for them.
💚 How did you test it?
test_units.pyforcollect_listed_tools: a description cleared to an empty or missing value, a category removed from_meta, clearing one value doesn't touch the other or other tools, and the happy paths still cache and replace values. The new tests that cover the bug fail without the fix and pass with it.test_fastmcp.pyandtest_fastmcp_v2.pythat check the properties are absent on$mcp_tool_callafter a listing clears them, and still present in the happy path.pytest posthog/test/mcp: 838 passed, 11 skipped. Full suite: 3 failures intest_metrics_autocapture.py(fork-related tests), which also fail onmainin my macOS environment.ruff format --check,ruff check, mypy with the baseline,python -W error -c "import posthog"andmake public_api_checkall pass. No public API change.mainand once on this branch. I had Claude Code run it and checked the resulting events myself in PostHog. Onmainthe event still carries the old description and category; on this branch both are absent.📝 Checklist
If releasing new changes
.sampo/changesets/mcp-clear-removed-tool-metadata.md, written by hand following recent changesets)🤖 Agent context
Autonomy: Human-driven (agent-assisted)
posthog.mcpcodebase, reproduce the issue, draft the fix and tests, and run the smoke test, and Claude (chat) to review the approach and the PR. I reviewed the changes, decided the scope and checked the smoke test results in PostHog myself.