Repository navigation
fix(content api): report GraphQL errors that have no locations - #528
Merged
mattrossman merged 2 commits intoNov 6, 2026
Merged
Conversation
The Content API leaves out locations on request-level errors, such as a query with two operations. The response schema required locations, so search_docs reported a parse failure instead of the error message. Make locations optional and add the position only when there is one. Fixes supabase#527
This was referenced Nov 6, 2026
Merged
barryroodt
pushed a commit
that referenced
this pull request
Nov 13, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>mcp-utils: 0.10.0</summary> ## [0.10.0](mcp-utils-v0.9.0...mcp-utils-v0.10.0) (2026-11-13) ### Features * tag cost-confirmation errors and report caller-input errors as ToolCallerError ([#543](#543)) ([ac366c4](ac366c4)) </details> <details><summary>mcp-server-supabase: 0.17.0</summary> ## [0.17.0](mcp-server-supabase-v0.16.1...mcp-server-supabase-v0.17.0) (2026-11-13) ### ⚠ BREAKING CHANGES * **elicitation:** split confirmation and secret collection TTLs ([#538](#538)) ### Features * agent feedback capabilities including docs ([#488](#488)) ([698ccd5](698ccd5)) * **elicitation:** split confirmation and secret collection TTLs ([#538](#538)) ([8a08e48](8a08e48)) * tag cost-confirmation errors and report caller-input errors as ToolCallerError ([#543](#543)) ([ac366c4](ac366c4)) ### Bug Fixes * **content api:** report GraphQL errors that have no locations ([#528](#528)) ([6b2fca9](6b2fca9)) * **mcp:** confirm UPDATEs without WHERE that have a leading comment, ONLY or an alias ([#524](#524)) ([7df9fb8](7df9fb8)) * **mcp:** don't read semicolons or EXECUTE inside data literals as destructive SQL ([#533](#533)) ([0dcdd2d](0dcdd2d)) * tell agents the log window, project readiness, docs query and SQL size rules up front ([#542](#542)) ([23f0df0](23f0df0)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
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.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
Fixes #527
graphqlErrorSchemarequireslocations, so a Content API error without it fails the response parse andsearch_docsreports the parse failure instead of the error message.What is the new behavior?
locationsis optional. The error message gets(line X, column Y)when the error has a location, and is shown alone when it does not. An emptylocationsarray, which used to print(line unknown, column unknown), follows the same rule.graphql_queryFailed to parse Supabase Content API response: [ … "path": ["errors", 0, "locations"] … ]Supabase Content API GraphQL error: GET requests must specify an operation name or send only a single operation{ nope }Supabase Content API GraphQL error: Cannot query field "nope" on type "RootQueryType". (line 1, column 3)No change to tool names, descriptions, or input and output schemas.
How to Review
Error schema and message
packages/mcp-server-supabase/src/content-api/graphql.tsgraphqlErrorSchema.locationsis optional, and thedata.errorsmessage adds the position only when there is one.Tests
packages/mcp-server-supabase/src/content-api/graphql.test.tsfetch: one withlocations, whose message is unchanged, and one without.Review questions
ToolCallerError, since the query is the caller's mistake? This PR keeps them as plainError.Verification
main, the no-locationscase fails with the parse error and the other cases pass.CI=1 npx vitest run --project unit: 34 files, 868 passed.npx tsc --noEmitandpnpm format:check: clean.search_docsagainst the live Content API gives the "after" column above.Additional context
search_docssends GET requests, so the Content API's wording is the GET one above rather than the POST message quoted in #527.