fix(connectors): return validation failures as MCP errors, not success results#154
Merged
Conversation
…s results
The GitHub and Google Drive connectors returned { error: '...' } for
user-facing validation failures, which normalized to a success McpToolResult,
so an agent could not detect failure via the MCP isError flag. Return
McpResponse.error(...) instead (isError: true).
@gemstack/connectors now re-exports McpResponse (+ the McpToolResult type) so a
connector's handle can signal these without importing @gemstack/mcp directly.
Closes #147
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #147.
The GitHub and Google Drive connectors returned
{ error: '...' }for user-facing validation failures (githubget-fileon a directory; driveget-file-contenton a folder, non-exportable mime; driveshare-filemissing email/domain).normalizeResultturned those into a successMcpToolResult, so an agent could not distinguish "failed" from "data" via the MCPisErrorflag.Changes:
McpResponse.error(...)for these branches (isError: true).@gemstack/connectorsre-exportsMcpResponse(+ theMcpToolResulttype) so a connector'shandlecan signal errors without importing@gemstack/mcpdirectly — the seam copiers will use.Tests: new kit test (handler
McpResponse.error→isError), new github directory-guard test, and the two existing drive validation tests updated to assertisError.pnpm typecheck+pnpm testgreen across all three packages (kit 9, github 8, drive 11).Changeset: connectors
minor(new re-export), the two connectorspatch.Note: overlaps
mountConnectors.ts/connector files with #146; independent change, sequence after #146.