{"record":{"id":"77d7afa7fc78b22a","repo":"googleapis/mcp-toolbox","slug":"tool-type-q-already-registered-77d7af","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/postgres/postgresliststoredprocedure/postgresliststoredprocedure.go","lineNumber":58,"sourceCode":"          l.lanname AS language,\n          pg_catalog.pg_get_functiondef(p.oid) AS definition,\n          pg_catalog.obj_description(p.oid, 'pg_proc') AS description\n      FROM pg_catalog.pg_proc p\n      JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n      JOIN pg_catalog.pg_roles r ON r.oid = p.proowner\n      JOIN pg_catalog.pg_language l ON l.oid = p.prolang\n      WHERE\n          p.prokind = 'p' AND\n          ($1::text IS NULL OR r.rolname LIKE '%' || $1::text || '%') AND\n          ($2::text IS NULL OR n.nspname LIKE '%' || $2::text || '%')\n      ORDER BY n.nspname, p.proname\n      LIMIT\n        COALESCE($3::int, 20);\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\tPostgresPool() *pgxpool.Pool\n}\n\n// validate compatible sources are still compatible\nvar _ compatibleSource = &alloydbpg.Source{}\nvar _ compatibleSource = &cloudsqlpg.Source{}","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/postgres/postgresliststoredprocedure/postgresliststoredprocedure.go#L40-L76","documentation":"The package's init() registers the 'postgres-list-stored-procedure' 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/postgres/postgresliststoredprocedure/postgresliststoredprocedure.go:58 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"}