Repository navigation
fix(mcp): quote identifiers in DESCRIBE METHOD for host-native relations - #927
Merged
jeffreyaven merged 1 commit intoNov 16, 2026
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The functional scenario uses the unchanged widgets branch, leaving the new stackql_preview quoting behavior without black-box regression coverage beyond the parser-only unit test.
1 open issue
What changed in this PR
Fixes MCP describe_method SQL generation for keyword-named methods such as list on host-native relations. This complements #909’s document-backed fix; shell parser changes remain out of scope.
Changes:
- Quotes every identifier segment and escapes embedded double quotes.
- Adds unit coverage for keyword method names and embedded quotes.
- Adds a robot scenario describing the mock provider’s
listmethod.
| File | Description |
|---|---|
test/robot/functional/stackql_method_schema.robot |
Registers the keyword-named method scenario. |
test/robot/functional/MethodSchemaLibrary.py |
Implements the MCP call and schema assertions. |
internal/stackql/mcpbackend/method_schema_test.go |
Checks parsing and keyword method-name preservation. |
internal/stackql/mcpbackend/mcp_service_stackql.go |
Quotes host-native DESCRIBE METHOD identifiers. |
Review effort: Balanced
| return message | ||
| request(1, "initialize", {"protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": {"name": "schema-test", "version": "1"}}) | ||
| process.stdin.write(b'{"jsonrpc":"2.0","method":"notifications/initialized"}\n') | ||
| args = {"provider": "widgets", "service": "things", "resource": "widgets", "method": "list", "format": "json"} |
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.

Description
describe_methodcould not describe a method namedlist. The host-native branch ofGetDescribeMethodbuilt theDESCRIBE METHODstatement by concatenating the identifiers unquoted, andlistlexes as a keyword, so the parser rejected it:Passing the name double-quoted worked, which pointed at the statement rather than the method itself. The fix quotes each segment of that statement (doubling an embedded quote so a name cannot escape the identifier). The quoted statement parses, and the parsed method still resolves to
listdownstream.The document-backed path was already fixed by #909 and is untouched.
Type of change
Issues referenced.
Fixes #926
Evidence
TestDescribeMethodQuotesKeywordMethodNamesininternal/stackql/mcpbackend/method_schema_test.go: the generated statement for methodlistparses and yields methodlist, and a name carrying a quote stays inside its quoted identifier.go test ./internal/stackql/mcpbackend/passes.test/robot/functional/stackql_method_schema.robot(MCP Describe Method Accepts Keyword Named Method), using the mock provider's existinglistmethod. Ran the whole file locally against a built binary: 6 passed, 0 failed.Checklist:
Variations
Testing was scoped to the affected packages rather than a full round: the
mcpbackendunit tests and thestackql_method_schemarobot file, both passing. The linter was not run locally for this change, and the change was verified on Linux only, so the platforms box is unchecked.Tech Debt
No technical debt results from this change set. Note the remaining shell-side half of #926: a
DESCRIBE METHOD ... liststatement typed in the shell still fails to parse, because the grammar itself rejects the keyword in that position. That needs the parser-side change in stackql-parser (acceptingLISTand friends as identifiers), which is a separate repository, so it is out of scope here.