{"record":{"id":"7319c1c3f6658230","repo":"googleapis/mcp-toolbox","slug":"tool-type-q-already-registered-7319c1","errorCode":null,"errorMessage":"tool type %q already registered","messagePattern":"tool type %q already registered","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/cockroachdb/cockroachdblistschemas/cockroachdblistschemas.go","lineNumber":47,"sourceCode":")\n\nconst resourceType string = \"cockroachdb-list-schemas\"\n\nconst listSchemasStatement = `\n\tSELECT\n\t\tcatalog_name,\n\t\tschema_name,\n\t\tcrdb_is_user_defined\n\tFROM information_schema.schemata\n\tWHERE schema_name NOT IN ('pg_catalog', 'information_schema', 'pg_toast', 'crdb_internal', 'pg_extension')\n\t\tAND schema_name NOT LIKE 'pg_temp_%'\n\t\tAND schema_name NOT LIKE 'pg_toast_temp_%'\n\tORDER BY schema_name;\n`\n\nfunc init() {\n\tif !tools.Register(resourceType, newConfig) {\n\t\tpanic(fmt.Sprintf(\"tool type %q already registered\", resourceType))\n\t}\n}\n\nfunc newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.ToolConfig, error) {\n\tactual := Config{ConfigBase: tools.ConfigBase{Name: name}}\n\tif err := decoder.DecodeContext(ctx, &actual); err != nil {\n\t\treturn nil, err\n\t}\n\treturn actual, nil\n}\n\ntype compatibleSource interface {\n\tQuery(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)\n}\n\nvar _ compatibleSource = &cockroachdb.Source{}\n\ntype Config struct {","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cockroachdb/cockroachdblistschemas/cockroachdblistschemas.go#L29-L65","documentation":"The package's init() registers the 'cockroachdb-list-schemas' 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.","triggerScenarios":"Thrown at internal/tools/cockroachdb/cockroachdblistschemas/cockroachdblistschemas.go:47 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}