You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(connectors): return validation failures as MCP errors, not success results (#154)
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
Return validation failures as MCP errors instead of success results.
8
+
9
+
The GitHub and Google Drive connectors returned `{ error: '...' }` for user-facing validation failures (get-file on a directory, get-file-content on a folder, share-file missing an email/domain). These normalized to a **success**`McpToolResult`, so an agent could not tell failure from data via the MCP `isError` flag. They now return `McpResponse.error(...)`, which sets `isError: true`.
10
+
11
+
`@gemstack/connectors` now re-exports `McpResponse` (and the `McpToolResult` type) so a connector's `handle` can signal these errors without depending on `@gemstack/mcp` directly.
A tool's `handle` may return a `string` (wrapped as text), any JSON-serializable value (wrapped as pretty JSON), or a full `McpToolResult` (use `McpResponse`from `@gemstack/mcp` for errors / images).
47
+
A tool's `handle` may return a `string` (wrapped as text), any JSON-serializable value (wrapped as pretty JSON), or a full `McpToolResult`. For an expected, user-facing failure (validation, not-found), return `McpResponse.error(...)` (re-exported from this package) so the client sees a failed tool call (`isError: true`) it can detect, rather than a success result that merely contains an `error` field. Reserve throwing for unexpected faults.
0 commit comments