Repository navigation
Commit d122124
committed
test(mcp): derive the tools/list cursor from the live tool count
Registering get_file_outline makes 17 tools. The pagination test passed the
literal cursor "8" and asserted no nextCursor came back, which silently
encoded "there are at most MCP_TOOLS_PAGE_SIZE * 2 tools". At 17 the tail
from offset 8 legitimately overflows one page, so the gate failed for a
reason that had nothing to do with pagination being wrong.
Production behaviour is correct and unchanged: the no-cursor path returns
every tool, and a cursored page emits nextCursor exactly while tools remain
after it. Only the test's hard-coded count assumption was wrong.
The offset is now derived from the live count, so the final page is asserted
wherever it falls and adding tool 18 will not break it. A positive control
asserts that page 0 DOES advertise a cursor, so the no-cursor assertion
cannot pass vacuously if paging stopped emitting altogether.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent 0b9df18 commit d122124
1 file changed
Lines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1437 | 1437 | | |
1438 | 1438 | | |
1439 | 1439 | | |
1440 | | - | |
1441 | | - | |
1442 | | - | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
1443 | 1458 | | |
1444 | 1459 | | |
1445 | 1460 | | |
1446 | | - | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
1447 | 1471 | | |
1448 | 1472 | | |
1449 | 1473 | | |
| |||
0 commit comments