MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / handleLintSQL

Function handleLintSQL

pkg/mcp/tools.go:324–334  ·  view source on GitHub ↗

handleLintSQL is the MCP tool handler for "lint_sql".

(ctx context.Context, req mcpmcp.CallToolRequest)

Source from the content-addressed store, hash-verified

322
323// handleLintSQL is the MCP tool handler for "lint_sql".
324func 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.

Callers 1

TestHandleLintSQLFunction · 0.85

Calls 3

lintSQLInternalFunction · 0.85
toolResultFunction · 0.85
ErrorfMethod · 0.65

Tested by 1

TestHandleLintSQLFunction · 0.68