Skip to main content
Glama

protolint-mcp

by yoheimuta
cmdList.go1.51 kB
package list import ( "fmt" "io" "github.com/yoheimuta/protolint/internal/addon/plugin/shared" "github.com/yoheimuta/protolint/internal/linter/config" "github.com/yoheimuta/protolint/internal/cmd/subcmds" "github.com/yoheimuta/protolint/internal/osutil" "github.com/yoheimuta/protolint/linter/autodisable" "github.com/yoheimuta/protolint/linter/rule" ) // CmdList is a rule list command. type CmdList struct { stdout io.Writer stderr io.Writer flags Flags } // NewCmdList creates a new CmdList. func NewCmdList( flags Flags, stdout io.Writer, stderr io.Writer, ) *CmdList { return &CmdList{ flags: flags, stdout: stdout, stderr: stderr, } } // Run lists each rule description. func (c *CmdList) Run() osutil.ExitCode { err := c.run() if err != nil { return osutil.ExitInternalFailure } return osutil.ExitSuccess } func (c *CmdList) run() error { rules, err := hasIDAndPurposes(c.flags.Plugins) if err != nil { return err } for _, r := range rules { _, err := fmt.Fprintf( c.stdout, "%s: %s\n", r.ID(), r.Purpose(), ) if err != nil { return err } } return nil } type hasIDAndPurpose interface { rule.HasID rule.HasPurpose } func hasIDAndPurposes(plugins []shared.RuleSet) ([]hasIDAndPurpose, error) { rs, err := subcmds.NewAllRules(config.RulesOption{}, false, autodisable.Noop, false, plugins) if err != nil { return nil, err } var rules []hasIDAndPurpose for _, r := range rs { rules = append(rules, r) } return rules, nil }

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/yoheimuta/protolint'

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