AI Minute - How to make better MCPs
I’ve now spent a significant amount of time writing and contributing to agent tooling, so I want to share one small detail that has a very big impact on the usability of your MCP.
Agents do not intuitively understand pagination, if you have a default limit set on a query, even if it is set in the tool command, the agent might not pick up on the fact that only 20 tasks were fetched and the default limit is 20 tasks. Even if it does that spends valuable “thinking” tokens.
The solution is very simple and twofold:
- If it doesn’t exist already, add a position indicator to the return on where the agent is in the output + something like a has_more field. This will hint to the agent that they should keep polling.
- Explain to the agent what the positioning is. Do not say “use position for pagination” Be explicit about what the agent needs to do to go to the next page.
You can see a good example of the second part from my recent change to jmap-mcp: https://github.com/wyattjoh/jmap-mcp/commit/da02d7884f24fc1b0bd626c46fcee9441e9b76f9
P.S. Thank you to Wyatt J. for his cooperation and a great MCP to build on!
First published on sensibleai.substack.com.