Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/ngpestelos/readwise-mcp-server/api-pagination-debuggingnpx skills add ngpestelos/readwise-mcp-server --skill api-pagination-debugginggit clone --depth 1 https://github.com/ngpestelos/readwise-mcp-serverWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ngpestelos/readwise-mcp-server/api-pagination-debugging)<a href="https://agentmods.dev/skills/ngpestelos/readwise-mcp-server/api-pagination-debugging"><img src="https://agentmods.dev/badge/skills/ngpestelos/readwise-mcp-server/api-pagination-debugging.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00093 | $0.03928 |
| Opus 5 | $0.00046 | $0.01964 |
| Sonnet 5 | $0.00019 | $0.00786 |
| Haiku 4.5 | $0.00009 | $0.00393 |
Grade A, and why
API Pagination Debugging scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl -s API_ENDPOINT | jq 'keys' How it starts
The opening of the file, as written. The whole thing — 592 lines — stays where its author put it; the contents beside it link to each section on GitHub.
API Pagination Debugging
Purpose: Systematically diagnose and fix pagination failures that prevent complete data import from APIs
Core Principles
1. Verify API Response Structure Before Assuming
Never assume pagination fields based on documentation or other endpoints. Always test actual responses:
curl -s API_ENDPOINT | jq 'keys'
Different API versions or endpoints may use different pagination patterns even within the same service.
2. Match Pagination Logic to API Design
APIs use distinct pagination patterns that require different implementations:
- Cursor-based:
{nextPageCursor, results}- use cursor param - Page-based:
{page, total_pages, results}- use page number param - Offset-based:
{offset, limit, total}- use offset/limit params - Link-based:
{next, previous, results}- follow next URL
Using the wrong pattern causes pagination to stop after first page.
3. Optimize Page Size for Efficiency
Most APIs support configurable page sizes (e.g., 50-1000 items per page). Using maximum page_size:
- Reduces total API calls (20x fewer calls with 1000 vs 50)
- Decreases network overhead
- Minimizes rate limit exposure
- Speeds up bulk imports
4. Test Pagination Flow Before Implementation
Before implementing pagination logic:
- Fetch page 1 and inspect response structure
- Manually fetch page 2 to confirm field values
- Verify cursor/page advancement works correctly
- Check termination condition (null cursor, empty results, etc.)
Systematic Debugging Workflow
Step 1: Reproduce the Issue
Symptoms of pagination failure:
- Import stops after exactly 1 page
- Returns same results repeatedly
- Status shows "completed_all_pages" but dataset incomplete
- Missing data compared to known totals
Example:
Expected: 74,386 highlights
Actual: 463 files (< 1% of total)
Status: "completed_all_pages" after 1 page
Step 2: Inspect Actual API Response
Don't trust assumptions - verify response structure:
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 592 lines · 93 tokens per session scan A 586a1376e860
API Pagination Debugging is a skill published in the GitHub repository ngpestelos/readwise-mcp-server (0 stars, last pushed 2mo ago), licensed MIT. It adds 93 tokens to every session and 3,928 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…