Skip to main content
Glama
grafana

Grafana

Official
by grafana
main.go1.16 kB
package main import ( "flag" "fmt" "os" "path/filepath" linter "github.com/grafana/mcp-grafana/internal/linter/jsonschema" ) func main() { var ( basePath string help bool fix bool ) flag.StringVar(&basePath, "path", ".", "Base directory to scan for Go files") flag.BoolVar(&help, "help", false, "Show help message") flag.BoolVar(&fix, "fix", false, "Automatically fix unescaped commas") flag.Parse() if help { fmt.Println("jsonschema-linter - A tool to find unescaped commas in jsonschema struct tags") fmt.Println("\nUsage:") flag.PrintDefaults() os.Exit(0) } // Resolve to absolute path absPath, err := filepath.Abs(basePath) if err != nil { fmt.Fprintf(os.Stderr, "Error resolving path: %v\n", err) os.Exit(1) } // Initialize linter jsonLinter := &linter.JSONSchemaLinter{ FixMode: fix, } // Find unescaped commas err = jsonLinter.FindUnescapedCommas(absPath) if err != nil { fmt.Fprintf(os.Stderr, "Error scanning files: %v\n", err) os.Exit(1) } // Print errors jsonLinter.PrintErrors() // Exit with error code if issues were found if len(jsonLinter.Errors) > 0 { os.Exit(1) } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/grafana/mcp-grafana'

If you have feedback or need assistance with the MCP directory API, please join our Discord server