When calling the get_pull_request_diff tool, the operation fails with the error: MCP error -32600: Structured content does not match the tool's output schema: data should NOT have additional properties.
Root Cause
An investigation revealed a mismatch between the PullRequestService.getPullRequestDiff implementation and the expectations of the generic toolService.
- OpenAPI Definition: The
openapi.yaml correctly defines the response for this endpoint as text/plain.
- Tool Service Behavior: The generic
toolService.mjs, when it encounters a text/plain response type, wraps the output schema in a JSON object for client compatibility. It expects the tool's handler to return a JSON object of the shape { "result": "..." }.
- Service Implementation: The
PullRequestService.getPullRequestDiff method currently returns the raw string output (stdout) from the gh pr diff command, not a JSON object.
This discrepancy causes the tool's output validation to fail.
Resolution
The getPullRequestDiff method in ai/mcp/server/github-workflow/services/PullRequestService.mjs needs to be modified. Instead of returning the raw stdout string, it must return a JSON object that conforms to the structure expected by the tool service:
return stdout;
return { result: stdout };
This will align the service's output with the tool's schema, resolving the validation error.
When calling the
get_pull_request_difftool, the operation fails with the error:MCP error -32600: Structured content does not match the tool's output schema: data should NOT have additional properties.Root Cause
An investigation revealed a mismatch between the
PullRequestService.getPullRequestDiffimplementation and the expectations of the generictoolService.openapi.yamlcorrectly defines the response for this endpoint astext/plain.toolService.mjs, when it encounters atext/plainresponse type, wraps the output schema in a JSON object for client compatibility. It expects the tool's handler to return a JSON object of the shape{ "result": "..." }.PullRequestService.getPullRequestDiffmethod currently returns the raw string output (stdout) from thegh pr diffcommand, not a JSON object.This discrepancy causes the tool's output validation to fail.
Resolution
The
getPullRequestDiffmethod inai/mcp/server/github-workflow/services/PullRequestService.mjsneeds to be modified. Instead of returning the rawstdoutstring, it must return a JSON object that conforms to the structure expected by the tool service:// Current incorrect return value return stdout; // Required correct return value return { result: stdout };This will align the service's output with the tool's schema, resolving the validation error.