Skip to content

list_instance_tools schemas:true is 433 B over the wire limit, measured but not asserted #578

Description

@serge-ivo

list_instance_tools with schemas:true is over the wire limit, and the guard records it without asserting it

#569 budgeted the default response down — production measured 66,042 B before, 53,970 B after,
confirmed by calling the deployed tool. The schemas:true path was not fixed and is
65,969 B, 433 B over the 64 KiB limit the default path is now held to.

e19d7a3 measures it and records the number. It deliberately does not assert the limit,
because making it fit means changing what the argument means, and #569's agent declined to ship
that as a guess. That was the right call and it is why this is a separate issue: the measurement
exists, the decision does not.

Why this is not "just raise the cap"

This repo has ruled on that shape twice. #503 budgeted a payload down rather than raising a cap
and cost the context window less than the bug did; #569 did the same and the whole point of the
allowed_only argument is to make the caller state what they need. Raising the limit for
schemas:true restates the problem one number higher.

The honest options, none of which are free:

  1. schemas:true implies allowed_only — a caller asking for full schemas almost certainly
    wants the tools the agent can actually run. Changes what the argument means; say so in the
    description.
  2. Paginate it, the way instance_messages returns nextCursor and hasMore: true and has no cursor input — every message older than the first page is unreachable over MCP #566 just gave instance_messages a real cursor. Consistent with a
    fix that landed today, and the only option that scales past one instance.
  3. Return schemas only for a named subset (tools: ["a","b"]). Cheapest, and matches how the
    payload is actually consumed — nobody reads 104 schemas.

Acceptance criteria

  1. schemas:true on the largest real instance is under the limit, measured on the deployed
    tool
    , not on the API body. list_instance_tools documents 2 of the 4 tier values it returns, and its default response is 117 KB — enough to exceed a host's limit on one instance #569's first fix passed its guard at ~54 KB while production
    served 66,042 B, because jsonText pretty-printed it after the assertion — the measurement
    must happen at the layer the client receives.
  2. The chosen option is stated with its cost, and the tool description matches the new behaviour.
  3. The guard asserts the limit rather than recording the number, and states its denominator per
    ADR 0002.
  4. Demonstrated red on the current 65,969 B payload.

Verified vs inferred

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions