Skip to content

feat(mcp): analytics listing defaults to view=summary for agents - #89

Merged
Gintm merged 2 commits into
developfrom
perf/mcp-analytics-summary-view
Nov 12, 2026
Merged

Gintm merged 2 commits into
developfrom
perf/mcp-analytics-summary-view

Conversation

@Gintm

@Gintm Gintm commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Why

zernio-dev/Schedule-Posts-API#8164 adds view=summary to GET /v1/analytics: no workspace accounts list, no per-platform copy of the metrics, no breakdown maps, no media list. On a real response shape that is 793K → 67K chars for a 50-post page in a 1,000-account workspace. The MCP should ask for it by default.

What

  • AGENT_VIEWS in the generator: getAnalytics gets view defaulting to summary (the agent can still pass full).
  • No effect until the spec carries view; the next regeneration after #8164 deploys picks it up.

🤖 Generated with Claude Code

Gintm and others added 2 commits November 12, 2026 10:33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…view

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gintm

Gintm commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Review (code-review high --fix)

Finding Outcome
Agent-view test lived in the header/binary params file Fixed: tests/test_mcp_agent_views.py
Override silently does nothing if the spec lacks view Fixed: the generator prints a warning, covered by a test

QA

Check Result
Generated signature with a spec that carries view view: Literal['full', 'summary'] = "summary", forwarded as view=view (test)
Regenerating from the current spec (no view yet) no change to generated_tools.py
Full suite 1,758 passed
Post-deploy (pending #8164 deploy and the next regeneration) call analytics_get_analytics on mcp.zernio.com with no view; expect no accounts, no platforms[].analytics, no breakdown maps, no mediaItems

Metrics

Metric Before (Nov 11 window) Expected
analytics_get_analytics result chars p95 / max / sum 475K / 954K / 508M under 80K / ≤ 80K / about −80%

Read from the mcp_tool_call logs (result_chars, raw_chars, truncated), same hours of day, posts_create_post as control.

@Gintm
Gintm merged commit 2992b2e into develop Nov 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant