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

Function toolResult

pkg/mcp/tools.go:242–248  ·  view source on GitHub ↗

toolResult marshals a map[string]any result into an MCP CallToolResult.

(data map[string]any)

Source from the content-addressed store, hash-verified

240
241// toolResult marshals a map[string]any result into an MCP CallToolResult.
242func toolResult(data map[string]any) (*mcpmcp.CallToolResult, error) {
243 b, err := json.Marshal(data)
244 if err != nil {
245 return nil, fmt.Errorf("failed to marshal result: %w", err)
246 }
247 return mcpmcp.NewToolResultText(string(b)), nil
248}
249
250// ---------------------------------------------------------------------------
251// MCP handler functions

Callers 9

handleValidateSQLFunction · 0.85
handleFormatSQLFunction · 0.85
handleParseSQLFunction · 0.85
handleExtractMetadataFunction · 0.85
handleSecurityScanFunction · 0.85
handleLintSQLFunction · 0.85
handleAnalyzeSQLFunction · 0.85
TestToolResult_ValidMapFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by 2

TestToolResult_ValidMapFunction · 0.68