I am building a Copilot agent to support faculty queries. My agent is connecting to Canvas (the Beta site) API via an MCP connection in Microsoft Azure. How do I instruct the agent on Canvas API pagination? Can I just tell the agent to keep looping or do I have to ask for MCP modifications? Any experience from the community is appreciated.
For example, to list students and faculty in an course, I often need more than 1 API call to get all of the data back. I tried this instruction but it doesn't seem reliable.
- Call page 1.
- Check how many users are returned.
- Continue calling the API for page 2, page 3, page 4, etc.
- Stop when a page returns no users.
- Combine users from all pages before responding.
Thank you