fix(mcplocal): make the paginated-result contract usable by any MCP client #111
Reference in New Issue
Block a user
Delete Branch "fix/paginator-drilldown-contract"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
UniFi tools were unusable from non-Claude agents (opencode, LibreChat).
Root cause. A tool result over 2000 chars is swapped for a table of contents and re-read via
_resultId/_section— but those params were never declared on the tool'sinputSchema, andunifi-networkandmy-grafanashipadditionalProperties: false. For any client that validates arguments the drill-down call is illegal, so the data is unreachable. The stub also said "Use section parameter", naming a param that does not exist; sending it fell through to the upstream, re-paginated and minted a fresh_resultId— an unbounded loop.Why UniFi specifically. It is the one server whose results always trip the threshold:
get_devices11,718 chars,get_clients136,696 across 19 pages with a 92-char page-1. Grafana and Gitea return compact results and never paginate.Changes
content-pipelinegainsonToolsList, declaring the two params on every tool it can paginate (gate tools excluded — intercepted before the pipeline).additionalPropertiesstaysfalse: a listed property is already legal under it, so the upstream keeps its typo protection.createDefaultPluginwired only the gate'sonToolsList; the pipeline's was silently dropped. Both chain now._resultIdwithout_sectionre-shows the ToC instead of forwarding an unknown arg upstream.deploy/mcplocal.serviceshipped a deadMCPLOCAL_MCPD_URL(10.0.0.194:3100); every working machine had a hand-written drop-in. Points at the k8s ingress now.Verification — live against the
sreproject with a real McpToken:get_devices11,718 -> 5,210 chars, no longer paginates at allget_clients136,696 -> 62,358 across 8 pages instead of 19_resultId+_sectionreturns real device data;_resultIdalone re-lists pages777 unit tests pass. 12 new tests in
plugin-content-pipeline-drilldown.test.ts(4 fail without the src changes) plus 3 smoke tests insmoke/tool-drilldown.test.tsthat fail against the deployed build and pass against the patched one.🤖 Generated with Claude Code
https://claude.ai/code/session_01JNXFvxanvM6uiFcb4Mp3xU