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

Function handleExtractMetadata

pkg/mcp/tools.go:298–308  ·  view source on GitHub ↗

handleExtractMetadata is the MCP tool handler for "extract_metadata".

(ctx context.Context, req mcpmcp.CallToolRequest)

Source from the content-addressed store, hash-verified

296
297// handleExtractMetadata is the MCP tool handler for "extract_metadata".
298func handleExtractMetadata(ctx context.Context, req mcpmcp.CallToolRequest) (*mcpmcp.CallToolResult, error) {
299 sql := req.GetString("sql", "")
300 if sql == "" {
301 return nil, fmt.Errorf("parameter 'sql' is required and must not be empty")
302 }
303 result, err := extractMetadataInternal(sql)
304 if err != nil {
305 return nil, err
306 }
307 return toolResult(result)
308}
309
310// handleSecurityScan is the MCP tool handler for "security_scan".
311func handleSecurityScan(ctx context.Context, req mcpmcp.CallToolRequest) (*mcpmcp.CallToolResult, error) {

Calls 3

extractMetadataInternalFunction · 0.85
toolResultFunction · 0.85
ErrorfMethod · 0.65