Capability results have no size bound, so a single call can blow the context window #20

Open
opened 2026-08-28 17:09:19 +09:00 by floot · 0 comments
Owner

One git.diff() in session mt82q1ns-l8nrge returned 360,427 characters
across 28,513 lines:

Error: result (360,427 characters across 28,513 lines) exceeds maximum allowed
tokens. Output has been saved to .../tool-results/mcp-endo-exec-*.txt

Because no capability accepts a limit, the agent defends itself by hand-slicing
every return value — .slice(0, 900), .slice(0, 1500), .slice(0, 2600)
appear constantly through the session. That produces truncated JSON it then has
to re-fetch with a different offset, so the guard itself costs extra calls.

Wanted: bounded reads as first-class arguments:

  • readText(path, { offset, limit })
  • git.diff({ maxBytes }), git.log({ fields })
  • list({ limit }) for large directories

so agents stop hand-slicing and re-fetching.

One `git.diff()` in session `mt82q1ns-l8nrge` returned 360,427 characters across 28,513 lines: ``` Error: result (360,427 characters across 28,513 lines) exceeds maximum allowed tokens. Output has been saved to .../tool-results/mcp-endo-exec-*.txt ``` Because no capability accepts a limit, the agent defends itself by hand-slicing every return value — `.slice(0, 900)`, `.slice(0, 1500)`, `.slice(0, 2600)` appear constantly through the session. That produces truncated JSON it then has to re-fetch with a different offset, so the guard itself costs extra calls. **Wanted:** bounded reads as first-class arguments: - `readText(path, { offset, limit })` - `git.diff({ maxBytes })`, `git.log({ fields })` - `list({ limit })` for large directories so agents stop hand-slicing and re-fetching.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
floot/endo#20
No description provided.