Skip to content

fix(mcp): let the read tool carry a request body - #8054

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/mcp-read-operation-body
Sep 20, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/mcp-read-operation-body

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • call_read_operation declared no body, so the six read operations that post their filter as JSON could not be called over MCP at all: searchKnowledge, queryRows, queryRowsCount, searchTableRows, getSelector, and listSelector
  • The read and write tools now share one input schema. They still differ where clients see it — description and annotations — and which operations each accepts is decided by resolveOperation, not by the schema
  • No dispatcher change: it already sends a body for any non-GET operation that declares one, and refuses a body for operations that do not, so that guard still applies to reads

Type of Change

  • Bug fix

Testing

Found by calling the deployed MCP server: describe_operation returns a body schema for these operations while the read tool offers nowhere to put it. Verified the fix end to end against a live server, and audited the whole catalog for the same class of gap — no GET declares a body, and every catalogued operation returns JSON, so these six were the only ones affected.

Regression test added to the existing tools/list test, which drives the real JSON-RPC route. Confirmed it fails without the fix (expected … to have property "body") and passes with it. Full MCP suite: 55 tests across 4 files. Lint and type-check clean.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

call_read_operation declared no body, so the six read operations that post their filter as JSON — searchKnowledge, queryRows, queryRowsCount, searchTableRows, getSelector, and listSelector — could not be called at all. The dispatcher already sends a body for any non-GET operation that declares one and refuses a body for operations that do not, so both call tools now share one input schema.
@vercel

vercel Bot commented Sep 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 20, 2026 2:27am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with the shared schema enabling body-bearing reads without weakening existing operation or request-body validation.

Summary

This PR allows MCP read calls to carry JSON request bodies by sharing the existing call schema between read and write tools.

  • Enables body-bearing read operations such as knowledge search and table queries.
  • Preserves operation-kind enforcement and the dispatcher’s rejection of bodies for operations that do not declare one.
  • Adds route-level schema regression coverage while retaining distinct read/write descriptions and annotations.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Client[MCP client] --> Read[call_read_operation]
    Client --> Write[call_write_operation]
    Read --> Shared[Shared callInput schema]
    Write --> Shared
    Shared --> Resolve[resolveOperation validates read/write kind]
    Resolve --> Dispatch[Dispatcher validates method and body declaration]
    Dispatch --> Route[Authorized API route]
Loading

Reviews (1) · Last reviewed commit: "fix(mcp): let the read tool carry a requ..."

@waleedlatif1
waleedlatif1 merged commit 83fd36a into staging Sep 20, 2026
34 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/mcp-read-operation-body branch September 20, 2026 02:31

This branch was previously deployed

1 inactive deployment
Preview 8c14aef0 Deployed Sep 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant