Skip to content

Read-only MCP mode filters actions but still advertises write-only properties #363

Description

@leggetter

What

Raised in review of #348 (comment).

Read-only mode filters the action enum, the tool description and the annotations — but not spec.Props. Every tool advertises its full property set in both modes, so a read-only session sees parameters that only the hidden write actions use.

Measured on the current branch, comparing each spec's props against those the read-available handlers actually read:

Tool Write-only props advertised in read-only mode
gateway_sources config, description, type
gateway_destinations config, description, type
gateway_connections description, rules
gateway_issues status
gateway_transformations none — code, env, request and connection_id belong to run, which is a read

Nine properties across four tools.

Why it matters

The handler gate is correct — Dispatch blocks the write action regardless, so nothing can be done with these. The cost is that the schema offers affordances the session cannot use, which is the same failure the events/requests split (#360) was about: a model reading gateway_sources in read-only mode sees config and type and has no way to know they belong to actions it was not offered. The best measurement available on this (WildAGTEval, arXiv 2601.00268) found irrelevant information in an API specification the worst of 60 complexity dimensions tested, at −27.3% for strong models.

The scale is much smaller than #360 — two or three properties rather than twenty-four — so this is a follow-up rather than a release blocker.

Options

  1. Per-property mode metadata. Add something like Prop.Write bool, and have Define filter props the same way it filters actions. Smallest change, keeps one spec per tool, and puts the two filters side by side so they cannot drift.
  2. Per-property action metadata. Tag each prop with the actions that use it and filter to the available set. More precise, more bookkeeping, and it starts to reinvent per-action schemas.
  3. Split read and write specs for mixed tools. Most faithful, but doubles the specs and cuts against the consolidation Pin + research: is our MCP tool shape (one tool per resource, action enum) still best practice? #359 concluded we should keep.

Option 1 looks right: it matches how actions are already handled, and the mapping is one boolean per property.

Whichever is chosen, it should come with a test in the shape of the existing coverage gates — assert that no property advertised in read-only mode is unused by the read-available actions, so a new write-only property cannot be added without noticing.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions