googleapis/mcp-toolbox · error
tool type %q already registered
Error message
tool type %q already registered
What it means
The package's init() registers the 'scylladb-cql' tool type in the global registry and panics if tools.Register returns false, meaning the type string was already claimed. This is a duplicate-registration guard for programming errors (e.g. a vendored or duplicated package copy linked into the binary), not a user config issue.
Source
Thrown at internal/tools/scylladb/scyllacql/scyllacql.go:34
import (
"context"
"fmt"
"net/http"
yaml "github.com/goccy/go-yaml"
gocql "github.com/gocql/gocql"
"github.com/googleapis/mcp-toolbox/internal/sources"
"github.com/googleapis/mcp-toolbox/internal/tools"
"github.com/googleapis/mcp-toolbox/internal/util"
"github.com/googleapis/mcp-toolbox/internal/util/parameters"
)
const resourceType string = "scylladb-cql"
func init() {
if !tools.Register(resourceType, newConfig) {
panic(fmt.Sprintf("tool type %q already registered", resourceType))
}
}
type compatibleSource interface {
ScyllaDBSession() *gocql.Session
RunSQL(context.Context, string, parameters.ParamValues) (any, error)
}
type Config struct {
tools.ConfigBase `yaml:",inline"`
Type string `yaml:"type" validate:"required"`
Source string `yaml:"source" validate:"required"`
Statement string `yaml:"statement" validate:"required"`
Parameters parameters.Parameters `yaml:"parameters"`
TemplateParameters parameters.Parameters `yaml:"templateParameters"`
Annotations *tools.ToolAnnotations `yaml:"annotations,omitempty"`
}
View on GitHub (pinned to 8cc6e09de2)
Solutions
- Ensure the package is not imported twice under different paths (e.g. vendored and module copies)
- Rename the conflicting resourceType constant if two distinct tools share it
- Clean go.mod/go.sum and rebuild to eliminate stale duplicate dependencies
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/tools/scylladb/scyllacql/scyllacql.go:34 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/f0e5ee2f9869ce4b.
Report an issue: GitHub.