Skip to content

feat: paginate MCP tool outputs to prevent truncation#36

Merged
George-iam merged 1 commit intomainfrom
feat/context-pagination-20260407
Apr 7, 2026
Merged

feat: paginate MCP tool outputs to prevent truncation#36
George-iam merged 1 commit intomainfrom
feat/context-pagination-20260407

Conversation

@George-iam
Copy link
Copy Markdown
Contributor

Summary

  • Add page parameter to axme_context, axme_oracle, axme_decisions, axme_memories
  • Server checks total output size against 25K char limit and splits by logical sections
  • Each page includes navigation instructions for the agent to call the next page
  • New paginateSections() utility in src/utils/pagination.ts
  • Section-returning functions added to oracle/decisions/memory storage modules

Tested on real workspace data

Tool Source Total chars Pages
oracle workspace 34K 2
oracle control-plane 26K 2
decisions axme-code 50K 3
decisions workspace 27K 2
context workspace 7K 1 (no split needed)

Test plan

  • 8 unit tests for pagination utility (edge cases, clamping, data preservation)
  • 5 integration tests with real .axme-code data (no data loss, correct page sizes)
  • Build + type check green
  • E2E: restart MCP server, call axme_oracle on workspace, verify page 1 returns with next-page instruction

Add page parameter to axme_context, axme_oracle, axme_decisions,
axme_memories. Server checks total output size against 25K char limit
and splits by logical sections, returning navigation instructions
for the agent to call next page.

Tested on real workspace data: oracle (2 pages), decisions (3 pages),
no data loss across pages.
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