Skip to content

Conversation

@dpelengic
Copy link

Adds pagination capabilities to the get_monitors tool for more efficient monitor listing and specific monitor retrieval.

Changes

  • Added pagination parameters:
    • idOffset: Start listing from a specific monitor ID
    • page: Page number (0-based)
    • pageSize: Number of monitors per page (default: 100)
  • Enhanced response to include last monitor ID
  • Updated README documentation

Use Cases

  • Standard pagination with page and pageSize
  • Cursor-based pagination with idOffset
  • Single monitor retrieval using idOffset with pageSize=1

All changes maintain backward compatibility and follow existing test patterns.

Dragan Pelengić and others added 2 commits May 7, 2025 12:55
Signed-off-by: Dragan Pelengić <dp@MacBook-Pro.local>
Signed-off-by: Dragan Pelengic <46516779+dpelengic@users.noreply.github.com>
@dpelengic dpelengic requested a review from winor30 as a code owner May 7, 2025 12:20
Copy link
Owner

@winor30 winor30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for your contribution!
i reviewd some comments. but almost lgtm

Comment on lines +110 to +117
...(monitors.length > 0
? [
{
type: 'text',
text: `Last monitor ID: ${monitors[monitors.length - 1].id}`,
},
]
: []),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think these logic can be more simplified

 monitors.length > 0 && {
    type: 'text',
    text: `Last monitor ID: 
  ${monitors[monitors.length - 1].id}`
  }

),
page: z
.number()
.int()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it is better

Suggested change
.int()
.int()
.min(0)

),
pageSize: z
.number()
.int()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.int()
.int()
.positive()

@codecov
Copy link

codecov bot commented Jun 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.98%. Comparing base (c08835e) to head (ab73386).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
+ Coverage   89.66%   89.98%   +0.32%     
==========================================
  Files          32       32              
  Lines        1238     1278      +40     
  Branches      153      155       +2     
==========================================
+ Hits         1110     1150      +40     
  Misses        128      128              

☔ 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.

@dpelengic dpelengic closed this Dec 2, 2025
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.

2 participants