Bug: MCP Server run-sql tool has invalid JSON Schema (regression in 25.4.0)
Environment
| Component |
Version |
| SQLcl |
25.4.0.346.1855 |
| OS |
macOS (Apple Silicon) |
| Java |
OpenJDK (Homebrew) |
Description
The run-sql tool in SQLcl's MCP server (sql -mcp) has an invalid JSON Schema that violates the JSON Schema draft 2020-12 specification. This causes strict MCP clients (e.g., Claude Code CLI) to reject the tool.
Error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"tools.22.custom.input_schema: JSON schema is invalid. It must match JSON Schema draft 2020-12"}}
Regression
- Works: SQLcl 25.3.2
- Broken: SQLcl 25.4.0
Root Cause
In the run-sql tool's inputSchema, the oneOf keyword is incorrectly placed inside properties instead of at the schema root level.
Current schema (invalid)
```json
{
"inputSchema": {
"type": "object",
"properties": {
"oneOf": [
{ "properties": {}, "required": ["sql"] },
{ "properties": {}, "required": ["job_id", "command"] }
]
}
}
}
Expected schema (valid)
{
inputSchema: {
type: object,
oneOf: [
{ properties: {}, required: [sql] },
{ properties: {}, required: [job_id, command] }
]
}
}
Steps to Reproduce
- Install SQLcl 25.4.0
- Start MCP server:
sql -mcp
3. Send MCP initialize + tools/list request
- Observe the run-sql tool's invalid schema
- Use with a strict MCP client → schema validation error
Workaround
Downgrade to SQLcl 25.3.2
Additional Notes
Some MCP clients (e.g., Claude Desktop) have lenient validation and happen to work, but the schema is still technically invalid per JSON Schema specification. Strict clients will reject it.
Bug: MCP Server
run-sqltool has invalid JSON Schema (regression in 25.4.0)Environment
Description
The
run-sqltool in SQLcl's MCP server (sql -mcp) has an invalid JSON Schema that violates the JSON Schema draft 2020-12 specification. This causes strict MCP clients (e.g., Claude Code CLI) to reject the tool.Error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"tools.22.custom.input_schema: JSON schema is invalid. It must match JSON Schema draft 2020-12"}}
Regression
Root Cause
In the
run-sqltool'sinputSchema, theoneOfkeyword is incorrectly placed insidepropertiesinstead of at the schema root level.Current schema (invalid)
```json { "inputSchema": { "type": "object", "properties": { "oneOf": [ { "properties": {}, "required": ["sql"] }, { "properties": {}, "required": ["job_id", "command"] } ] } } }Expected schema (valid)
{ inputSchema: { type: object, oneOf: [ { properties: {}, required: [sql] }, { properties: {}, required: [job_id, command] } ] } }Steps to Reproduce
sql -mcp
3. Send MCP initialize + tools/list request
Workaround
Downgrade to SQLcl 25.3.2
Additional Notes
Some MCP clients (e.g., Claude Desktop) have lenient validation and happen to work, but the schema is still technically invalid per JSON Schema specification. Strict clients will reject it.