René's URL Explorer Experiment


Title: [FEATURE] MCP tools return empty result sets on upstream HTTP errors instead of erroring · Issue #670 · stackql/stackql · GitHub

Open Graph Title: [FEATURE] MCP tools return empty result sets on upstream HTTP errors instead of erroring · Issue #670 · stackql/stackql

X Title: [FEATURE] MCP tools return empty result sets on upstream HTTP errors instead of erroring · Issue #670 · stackql/stackql

Description: Summary When a provider API call fails (401/403/404/429/5xx), run_select_query over MCP returns a successful tool result with {"rows": []}. The HTTP failure is only visible on the server process's stderr. MCP clients cannot distinguish "...

Open Graph Description: Summary When a provider API call fails (401/403/404/429/5xx), run_select_query over MCP returns a successful tool result with {"rows": []}. The HTTP failure is only visible on the server process's ...

X Description: Summary When a provider API call fails (401/403/404/429/5xx), run_select_query over MCP returns a successful tool result with {"rows": []}. The HTTP failure is only visible on the server ...

Opengraph URL: https://github.com/stackql/stackql/issues/670

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[FEATURE] MCP tools return empty result sets on upstream HTTP errors instead of erroring","articleBody":"## Summary\n\nWhen a provider API call fails (401/403/404/429/5xx), `run_select_query`\nover MCP returns a successful tool result with `{\"rows\": []}`. The HTTP\nfailure is only visible on the server process's stderr. MCP clients cannot\ndistinguish \"query ran, zero rows\" from \"query failed\", and absence-based\nchecks (e.g. compliance controls of the form \"this query must return no\nrows\") silently false-pass.\n\nThis is fixable entirely within stackql/stackql - any-sdk already returns\nthe erroneous response to the caller (see analysis below).\n\n## Reproduction\n\nExhaust the unauthenticated GitHub rate limit (60 req/h/IP), then via MCP\nstdio with `--auth='{\"github\": {\"type\": \"null_auth\"}}'`:\n\n~~~json\n{\"name\": \"run_select_query\", \"arguments\": {\"sql\": \"SELECT name FROM github.repos.repos WHERE org = 'stackql'\"}}\n~~~\n\nServer stderr shows:\n\n~~~text\nhttp response status code: 403, response body: {\"message\":\"API rate limit exceeded for ...\"}\n~~~\n\nbut the tool result is `isError: false` with `structuredContent.rows: []`\nand a \"**no results**\" markdown rendering. Observed on v0.10.500.\n\n## Analysis\n\n- any-sdk's HTTP layer (`internal/anysdk/client.go`,\n  `parseReponseBodyIfErroneous`) logs the error body to stderr but returns\n  the full non-2xx `*http.Response` to stackql with the body re-buffered -\n  the status code and body are available downstream. No any-sdk change is\n  required.\n- The swallow points are in\n  `internal/stackql/execution/mono_valent_execution.go`:\n  - the plain-select path returns success with a nil payload on erroneous\n    responses:\n\n    ~~~go\n    if httpResponse.StatusCode \u003e= 300 {\n        return newHTTPProcessorResponse(nil, reversalStream, false, nil)\n    }\n    ~~~\n\n  - similarly, `res.HasError()` routes the error text into the message\n    handler and returns a nil error.\n\n  By contrast the `isMaterialiseResponse` branch already generates an\n  error for `StatusCode \u003e= 400`, so mutations/materialised ops surface\n  failures - it is specifically selects that degrade to empty results.\n- `internal/stackql/mcpbackend.extractQueryResults` already checks\n  `resp.GetError()` and would propagate a populated error; today it can\n  only ever produce the opaque `failed to extract query results`.\n\n## Proposed fix (two layers, both in this repo)\n\n1. **Execution**: in the select path of `mono_valent_execution.go`, treat\n   `StatusCode \u003e= 400` as an error (mirroring the materialise branch),\n   carrying status code and response body into the `ExecutorOutput` error\n   instead of returning `(nil payload, nil error)`.\n2. **MCP surface** (`pkg/mcp_server`): map backend errors to\n   `CallToolResult` with `isError: true` and a structured error payload in\n   the text/structured content, including a retryability classification:\n\n   ~~~json\n   {\n     \"error\": {\n       \"message\": \"GET https://api.github.com/... failed\",\n       \"http_status\": 403,\n       \"provider\": \"github\",\n       \"retryable\": false\n     }\n   }\n   ~~~\n\n   Suggested classification: 408/429/5xx retryable; 400/401/403/404 not\n   (with 403-rate-limit bodies ideally classified as retryable, since\n   GitHub uses 403 for rate limiting).\n\n## Impact\n\nAny MCP client running absence-based checks gets false negatives today.\nThe interim mitigation we ship in auditron (stackql-mcp-rs demo) is a\ncanary control (`SELECT` that must return rows) whose failure flags a\nbroken run - workable, but it shouldn't be necessary, and it cannot\nattribute the failure or advise on retry.\n","author":{"url":"https://github.com/jeffreyaven","@type":"Person","name":"jeffreyaven"},"datePublished":"2026-06-13T01:11:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/670/stackql/issues/670"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ffdd876e-0ee1-ac51-d8ed-4b53604c5125
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBF9C:38840C:9DB9F2:D5E164:6A4D4F03
html-safe-noncea7db8858a05ada7795cb18bd9860b8e559a2d3d9feafd82d39e580d04dcaf071
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjlDOjM4ODQwQzo5REI5RjI6RDVFMTY0OjZBNEQ0RjAzIiwidmlzaXRvcl9pZCI6Ijg4MDcxNjIxNjgzMjU1MjUyNTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac731287ea604bd288a3d29a52d5fb8fbc14a033dc3e7b925b1b74b770ae90b487
hovercard-subject-tagissue:4653701391
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/stackql/stackql/670/issue_layout
twitter:imagehttps://opengraph.githubassets.com/83a89cee622c4bfc206bea820ef795fdaaa5059cd0d439ccbefd2a155aa267a6/stackql/stackql/issues/670
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/83a89cee622c4bfc206bea820ef795fdaaa5059cd0d439ccbefd2a155aa267a6/stackql/stackql/issues/670
og:image:altSummary When a provider API call fails (401/403/404/429/5xx), run_select_query over MCP returns a successful tool result with {"rows": []}. The HTTP failure is only visible on the server process's ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejeffreyaven
hostnamegithub.com
expected-hostnamegithub.com
None92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6
turbo-cache-controlno-preview
go-importgithub.com/stackql/stackql git https://github.com/stackql/stackql.git
octolytics-dimension-user_id95105302
octolytics-dimension-user_loginstackql
octolytics-dimension-repository_id443987542
octolytics-dimension-repository_nwostackql/stackql
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id443987542
octolytics-dimension-repository_network_root_nwostackql/stackql
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release56fc8347865a14e2ec811533d68f929cf4e0ec19
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/stackql/stackql/issues/670#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fstackql%2Fstackql%2Fissues%2F670
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fstackql%2Fstackql%2Fissues%2F670
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=stackql%2Fstackql
Reloadhttps://github.com/stackql/stackql/issues/670
Reloadhttps://github.com/stackql/stackql/issues/670
Reloadhttps://github.com/stackql/stackql/issues/670
Please reload this pagehttps://github.com/stackql/stackql/issues/670
stackql https://github.com/stackql
stackqlhttps://github.com/stackql/stackql
Please reload this pagehttps://github.com/stackql/stackql/issues/670
Notifications https://github.com/login?return_to=%2Fstackql%2Fstackql
Fork 80 https://github.com/login?return_to=%2Fstackql%2Fstackql
Star 861 https://github.com/login?return_to=%2Fstackql%2Fstackql
Code https://github.com/stackql/stackql
Issues 101 https://github.com/stackql/stackql/issues
Pull requests 1 https://github.com/stackql/stackql/pulls
Discussions https://github.com/stackql/stackql/discussions
Actions https://github.com/stackql/stackql/actions
Projects https://github.com/stackql/stackql/projects
Wiki https://github.com/stackql/stackql/wiki
Security and quality 0 https://github.com/stackql/stackql/security
Insights https://github.com/stackql/stackql/pulse
Code https://github.com/stackql/stackql
Issues https://github.com/stackql/stackql/issues
Pull requests https://github.com/stackql/stackql/pulls
Discussions https://github.com/stackql/stackql/discussions
Actions https://github.com/stackql/stackql/actions
Projects https://github.com/stackql/stackql/projects
Wiki https://github.com/stackql/stackql/wiki
Security and quality https://github.com/stackql/stackql/security
Insights https://github.com/stackql/stackql/pulse
#680https://github.com/stackql/stackql/pull/680
[FEATURE] MCP tools return empty result sets on upstream HTTP errors instead of erroringhttps://github.com/stackql/stackql/issues/670#top
#680https://github.com/stackql/stackql/pull/680
https://github.com/jeffreyaven
enhancementNew feature or requesthttps://github.com/stackql/stackql/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/jeffreyaven
jeffreyavenhttps://github.com/jeffreyaven
on Jun 13, 2026https://github.com/stackql/stackql/issues/670#issue-4653701391
jeffreyavenhttps://github.com/jeffreyaven
enhancementNew feature or requesthttps://github.com/stackql/stackql/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.