Send GET to /services/data/vXX.0/query?q={URL-encoded SOQL} to start the query
Inspect the response: if done is false, a nextRecordsUrl property is present
Fetch the next page by sending GET to the base instance URL + nextRecordsUrl value (it is a relative path)
Repeat until the done field in the response is true
Collect records from the records array across all pages
Known gotchas
queryMore is the SOAP API concept; in REST the continuation is simply a GET to nextRecordsUrl — do not call a separate queryMore endpoint
Session expiry mid-pagination invalidates the cursor; build retry logic around 401 responses
SOQL LIMIT clauses cap the total rows returned, not the page size; page size is controlled by the Salesforce server (typically up to 2000 rows per batch)
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp