Skip to content

fix(connectors): return validation failures as MCP errors, not success results#154

Merged
suleimansh merged 1 commit into
mainfrom
fix/connectors-error-results
Jul 2, 2026
Merged

fix(connectors): return validation failures as MCP errors, not success results#154
suleimansh merged 1 commit into
mainfrom
fix/connectors-error-results

Conversation

@suleimansh

Copy link
Copy Markdown
Member

Closes #147.

The GitHub and Google Drive connectors returned { error: '...' } for user-facing validation failures (github get-file on a directory; drive get-file-content on a folder, non-exportable mime; drive share-file missing email/domain). normalizeResult turned those into a success McpToolResult, so an agent could not distinguish "failed" from "data" via the MCP isError flag.

Changes:

  • Both reference connectors now return McpResponse.error(...) for these branches (isError: true).
  • @gemstack/connectors re-exports McpResponse (+ the McpToolResult type) so a connector's handle can signal errors without importing @gemstack/mcp directly — the seam copiers will use.
  • Kit README documents the convention.

Tests: new kit test (handler McpResponse.errorisError), new github directory-guard test, and the two existing drive validation tests updated to assert isError. pnpm typecheck + pnpm test green across all three packages (kit 9, github 8, drive 11).

Changeset: connectors minor (new re-export), the two connectors patch.

Note: overlaps mountConnectors.ts/connector files with #146; independent change, sequence after #146.

…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
@suleimansh suleimansh added bug Something isn't working priority: high Should be addressed soon labels Jul 2, 2026
@suleimansh suleimansh self-assigned this Jul 2, 2026
@suleimansh suleimansh merged commit e8d730f into main Jul 2, 2026
2 checks passed
@suleimansh suleimansh deleted the fix/connectors-error-results branch July 2, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: high Should be addressed soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

connectors: validation branches return success instead of MCP errors

1 participant