Skip to content

codedb_remote: tree/commits/dep-history overflow MCP token limits — add pagination #332

@justrach

Description

@justrach

Problem

codedb_remote actions that return list-shaped data routinely exceed the MCP tool-result size limit and force callers to dump-to-file + jq. Reproductions from a fresh exercise of the tool:

call size
action=tree, repo=justrach/merjs (codegraff) 65 KB
action=tree, repo=anthropics/anthropic-sdk-python, backend=wiki 109 KB
action=commits, repo=anthropics/anthropic-sdk-python, backend=wiki 118 KB

Each of these blows past the per-tool-result token cap, so the agent can't read the response inline — it has to fork a subagent or pipe to jq. The repos involved aren't unusual (~4 MB index sizes).

Proposal

Accept query params:

  • tree: ?prefix=src/, ?limit=N, ?offset=N, ?expand=true|false
  • commits: ?since=<ISO|sha>, ?limit=N
  • dep-history: ?since=<ISO|sha>, ?limit=N

Default behavior should stay backwards-compatible — only slice the response when a param is provided. The MCP client (handleRemote in src/mcp.zig) should accept these params and forward them through.

Why

This is the single biggest usability pothole in the tool today. A 30-min server-side fix in codedb-cloud unlocks routine large-repo exploration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions