Skip to content

Conversation

@shivasurya
Copy link
Owner

@shivasurya shivasurya commented Jan 10, 2026

Summary

Implements cursor-based pagination for MCP tools returning large datasets.

Features:

  • Base64 URL-safe cursor encoding
  • Configurable page size (default: 50, max: 200)
  • Generic PaginateSlice[T] function using Go generics
  • Cursor preserves query context for consistent pagination

Pagination parameters:

Parameter Type Description
limit int Items per page (1-200)
cursor string Opaque cursor for next page

Response structure:

{
  "items": [...],
  "next_cursor": "...",
  "has_more": true,
  "total": 150
}

Applied to find_symbol, get_callers, and get_callees tools.

@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

❌ Patch coverage is 94.39252% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.11%. Comparing base (37e4822) to head (1c2641f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sast-engine/mcp/tools.go 87.23% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #457      +/-   ##
==========================================
+ Coverage   81.02%   81.11%   +0.08%     
==========================================
  Files          90       91       +1     
  Lines        9936    10014      +78     
==========================================
+ Hits         8051     8123      +72     
- Misses       1575     1578       +3     
- Partials      310      313       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shivasurya shivasurya marked this pull request as ready for review January 10, 2026 04:05
@safedep
Copy link

safedep bot commented Jan 10, 2026

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

@shivasurya shivasurya force-pushed the shiva/mcp-error-handling branch from cce2c7b to b265133 Compare January 10, 2026 04:43
@shivasurya shivasurya force-pushed the shiva/mcp-pagination branch from 78c5531 to 3f2d8aa Compare January 10, 2026 04:43
Copy link
Owner Author

shivasurya commented Jan 10, 2026

Merge activity

  • Jan 10, 4:45 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 10, 4:51 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jan 10, 4:51 AM UTC: @shivasurya merged this pull request with Graphite.

@shivasurya shivasurya changed the base branch from shiva/mcp-error-handling to graphite-base/457 January 10, 2026 04:48
@shivasurya shivasurya changed the base branch from graphite-base/457 to main January 10, 2026 04:49
Implement pagination support for tools that return potentially large result sets:
- Add PaginateSlice generic function for slicing with cursor support
- Add EncodeCursor/DecodeCursor for opaque base64-encoded cursors
- Add ExtractPaginationParams for validation and default limits
- Update find_symbol, get_callers, get_callees to support pagination
- Default limit: 50, max limit: 500

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@shivasurya shivasurya force-pushed the shiva/mcp-pagination branch from 3f2d8aa to 1c2641f Compare January 10, 2026 04:50
@shivasurya shivasurya merged commit c923c7a into main Jan 10, 2026
3 checks passed
@shivasurya shivasurya deleted the shiva/mcp-pagination branch January 10, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants