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 'vector-assist-modify-spec' 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/cloudsqlpg/vectorassistmodifyspec/vectorassistmodifyspec.go:47
)
const resourceType string = "vector-assist-modify-spec"
const modifySpecQuery = `
SELECT recommendation_id, vector_spec_id, table_name, schema_name, query, recommendation, applied, modified, created_at
FROM vector_assist.modify_spec(spec_id => @spec_id::TEXT, table_name => @table_name::TEXT, schema_name => @schema_name::TEXT,
vector_column_name => @vector_column_name::TEXT, text_column_name => @text_column_name::TEXT,
vector_index_type => @vector_index_type::TEXT, embeddings_available => @embeddings_available::BOOLEAN,
num_vectors => @num_vectors::INTEGER, dimensionality => @dimensionality::INTEGER,
embedding_model => @embedding_model::TEXT, prefilter_column_names => @prefilter_column_names,
distance_func => @distance_func::TEXT, quantization => @quantization::TEXT,
memory_budget_kb => @memory_budget_kb::INTEGER, target_recall => @target_recall::FLOAT,
target_top_k => @target_top_k::INTEGER, tune_vector_index => @tune_vector_index::BOOLEAN);
`
func init() {
if !tools.Register(resourceType, newConfig) {
panic(fmt.Sprintf("tool type %q already registered", resourceType))
}
}
func newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.ToolConfig, error) {
actual := Config{ConfigBase: tools.ConfigBase{Name: name}}
if err := decoder.DecodeContext(ctx, &actual); err != nil {
return nil, err
}
return actual, nil
}
type compatibleSource interface {
PostgresPool() *pgxpool.Pool
RunSQL(context.Context, string, []any) (any, error)
}
type Config struct {
tools.ConfigBase `yaml:",inline"`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/cloudsqlpg/vectorassistmodifyspec/vectorassistmodifyspec.go:47 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/e0f771f77bf5c9fd.
Report an issue: GitHub.