handleLintSQL is the MCP tool handler for "lint_sql".
(ctx context.Context, req mcpmcp.CallToolRequest)
| 322 | |
| 323 | // handleLintSQL is the MCP tool handler for "lint_sql". |
| 324 | func handleLintSQL(ctx context.Context, req mcpmcp.CallToolRequest) (*mcpmcp.CallToolResult, error) { |
| 325 | sql := req.GetString("sql", "") |
| 326 | if sql == "" { |
| 327 | return nil, fmt.Errorf("parameter 'sql' is required and must not be empty") |
| 328 | } |
| 329 | result, err := lintSQLInternal(sql) |
| 330 | if err != nil { |
| 331 | return nil, err |
| 332 | } |
| 333 | return toolResult(result) |
| 334 | } |
| 335 | |
| 336 | // handleAnalyzeSQL is the MCP tool handler for "analyze_sql". |
| 337 | // It fans out all six analysis tools concurrently and merges the results. |