Skip to content

pageIdx without pageSize returns 20 items, contrary to "When omitted, returns all" in list_console_messages and list_network_requests #2996

Closed

Description

@coygeek

Description of the bug

list_console_messages and list_network_requests document pageSize as "When omitted, returns all messages" / "returns all requests". When a caller passes pageIdx but omits pageSize, both tools instead page with a hidden size of 20: pageIdx: 0 returns items 1 to 20 of 25, and pageIdx: 1 returns items 21 to 25. Omitting both parameters returns all 25. Both tested builds behave the same.

Actual behavior

Both builds:

list_console_messages {}            -> Showing 1-25 of 25 (Page 1 of 1).
list_console_messages {pageIdx: 0}  -> Showing 1-20 of 25 (Page 1 of 2). Next page: 1
list_console_messages {pageIdx: 1}  -> Showing 21-25 of 25 (Page 2 of 2). Previous page: 0

Reproduction

  1. Open any page, for example <!doctype html><title>blank</title><p>blank</p> saved as blank.html and served with python3 -m http.server PORT --bind 127.0.0.1.
  2. Send these tools/call requests:
{"name":"new_page","arguments":{"url":"http://127.0.0.1:PORT/blank.html"}}
{"name":"evaluate_script","arguments":{"pageId":2,"function":"() => { for (let i = 0; i < 25; i++) console.log('m' + i); return 1; }"}}
{"name":"list_console_messages","arguments":{"pageId":2}}
{"name":"list_console_messages","arguments":{"pageId":2,"pageIdx":0}}
{"name":"list_console_messages","arguments":{"pageId":2,"pageIdx":1}}

The sequence was run once per build. Another investigator observed the same behavior for list_network_requests with 21 requests (pageIdx: 0 without pageSize printed Showing 1-20 of 21 (Page 1 of 2)); both tools call the same paginate() helper.

Expectation

The schemas of both tools say, for pageSize, "Maximum number of messages to return. When omitted, returns all messages." (list_console_messages) and "Maximum number of requests to return. When omitted, returns all requests." (list_network_requests), and for pageIdx, "Page number to return (0-based). When omitted, returns the first page." With pageSize omitted, the documented page size is "all", so pageIdx: 0 should return all 25 messages. If a default page size applies whenever pageIdx is given, the pageSize description should state it.

MCP configuration

--headless --isolated --no-usage-statistics --no-performance-crux unless the reproduction states otherwise (update checks disabled with CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1).

Chrome DevTools MCP version

1.10.1 (npm) and main 5ddb0a3 (local build)

Chrome version

154.0.8037.98 (stable)

Node version

v22.23.2

Operating system

macOS 27.0

Environment details

  • chrome-devtools-mcp 1.10.1 from npm (the release build).
  • chrome-devtools-mcp built from main at commit 5ddb0a3 (the main build).
  • Google Chrome 154.0.8037.98 stable, headless; Node v22.23.2; macOS 27.
  • Both builds were started with --headless --isolated --no-usage-statistics --no-performance-crux and CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1, and driven by a scripted stdio MCP client. In a fresh isolated session the page opened by new_page has page ID 2.

Evidence

  • Expected source: pageSize and pageIdx descriptions in src/tools/console.ts:53-67 and src/tools/network.ts:43-56 on the main build, repeated in docs/tool-reference.md.
  • Failure source: scripted MCP runs above on both builds. paginate() returns all items only when both options are undefined and otherwise uses options.pageSize ?? DEFAULT_PAGE_SIZE with DEFAULT_PAGE_SIZE = 20 (src/utils/pagination.ts:20-41 on the main build).
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

The list_network_requests observation is from an earlier run in this investigation; the shared helper makes the same path apply.

Fix check

With the steps above, either list_console_messages {pageIdx: 0} returns all 25 messages (and {pageIdx: 1} reports an out-of-range page), or the pageSize descriptions of both tools state that a page size of 20 applies when pageIdx is given without pageSize, so the documented and observed counts agree. Control: {} still returns all 25, and {pageSize: 10, pageIdx: 1} still returns messages 11 to 20.

Additional context

The full open and closed issue and PR corpus was screened as of 2026-10-06; no issue covers this mismatch (closed #136 added pagination and #688 replaced page indexes for pages, not list paging). get_css_styles documents its own default ("Defaults to 10") and was not checked. An out-of-range pageIdx returns the first page with the note Invalid page number provided. Showing first page., which is explicit behavior and not part of this report.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions