Skip to content

feat: add max_lines to memories MCP read#20991

Merged
jif-oai merged 1 commit into
mainfrom
jif/read-max-lines
May 4, 2026
Merged

feat: add max_lines to memories MCP read#20991
jif-oai merged 1 commit into
mainfrom
jif/read-max-lines

Conversation

@jif-oai

@jif-oai jif-oai commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Why

The memories MCP read tool already supports line_offset, but it cannot return a bounded line range. That makes it awkward to page through large memory files or request a small slice without relying on token truncation.

What changed

  • add an optional max_lines parameter to the memories MCP read tool schema and request parsing
  • cap local backend reads to the requested number of lines before token truncation
  • treat max_lines = 0 as an invalid request and surface it as invalid_params
  • add backend tests for bounded reads and invalid line request validation

Testing

  • added coverage in memories/mcp/src/local_tests.rs for max_lines reads and invalid max_lines / line_offset requests

@jif-oai jif-oai changed the title feat: mcp memories max lines feat: add max_lines to memories MCP read May 4, 2026
@jif-oai jif-oai merged commit 6b6581a into main May 4, 2026
26 checks passed
@jif-oai jif-oai deleted the jif/read-max-lines branch May 4, 2026 12:45
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant