{"record":{"id":"3251844678d94a76","repo":"googleapis/mcp-toolbox","slug":"unknown-prompt-type-q","errorCode":null,"errorMessage":"unknown prompt type: %q","messagePattern":"unknown prompt type: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/prompts/prompts.go","lineNumber":55,"sourceCode":"\tif _, exists := promptRegistry[resourceType]; exists {\n\t\t// Prompt with this type already exists, do not overwrite.\n\t\treturn false\n\t}\n\tpromptRegistry[resourceType] = factory\n\treturn true\n}\n\n// DecodeConfig looks up the registered factory for the given type and uses it\n// to decode the prompt configuration.\nfunc DecodeConfig(ctx context.Context, resourceType, name string, decoder *yaml.Decoder) (PromptConfig, error) {\n\tfactory, found := promptRegistry[resourceType]\n\tif !found && resourceType == \"\" {\n\t\tresourceType = \"custom\"\n\t\tfactory, found = promptRegistry[resourceType]\n\t}\n\n\tif !found {\n\t\treturn nil, fmt.Errorf(\"unknown prompt type: %q\", resourceType)\n\t}\n\n\tpromptConfig, err := factory(ctx, name, decoder)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to parse prompt %q as resourceType %q: %w\", name, resourceType, err)\n\t}\n\treturn promptConfig, nil\n}\n\ntype PromptConfig interface {\n\tPromptConfigType() string\n\tInitialize() (Prompt, error)\n}\n\ntype Prompt interface {\n\tGetDesc() string\n\tGetArguments() Arguments\n\tSubstituteParams(parameters.ParamValues) (any, error)","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/prompts/prompts.go#L37-L73","documentation":"DecodeConfig resolves a prompt's `kind` (resourceType) against the promptRegistry of registered prompt factories, defaulting to \"custom\" when kind is empty. It throws this error when the kind is set to a value that has no registered factory, so the prompt config cannot be decoded.","triggerScenarios":"A prompt in tools.yaml declares `kind: mydb_prompt` (or any non-empty kind other than registered types like \"custom\"), and no factory for that kind was registered via the registry's Register call at init time.","commonSituations":"Typo in kind (e.g. \"Custom\" with capital C); copying a kind from a tools/config section into a prompts section where it isn't valid; using a kind from an extension not imported into the binary so its init never ran; version mismatch where the kind was added in a newer release.","solutions":["Remove the `kind:` field or set it to `custom` to use the default prompt factory.","Check spelling/casing of kind against the registered prompt types (e.g. the keys in promptRegistry).","Ensure the package providing the custom prompt factory is imported so its init() registers it.","Upgrade the toolbox binary if the kind is only supported in newer versions."],"exampleFix":"// before\nprompts:\n  my-prompt:\n    kind: gcp_prompt\n    description: ...\n// after\nprompts:\n  my-prompt:\n    kind: custom\n    description: ...","handlingStrategy":"validation","validationCode":"knownKinds := map[string]bool{\"\": true, \"custom\": true /* + registered kinds */}\nif !knownKinds[promptCfg.Kind] {\n\treturn fmt.Errorf(\"prompt kind %q unknown; use 'custom' or omit kind\", promptCfg.Kind)\n}","typeGuard":null,"tryCatchPattern":"pc, err := prompts.DecodeConfig(ctx, name, decoder)\nif err != nil {\n\tif strings.Contains(err.Error(), \"unknown prompt type\") {\n\t\treturn fmt.Errorf(\"set prompts kind to 'custom' (or omit it); %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Omit `kind:` in prompt definitions unless using a registered custom prompt type.","Check kind spelling/casing against registered prompt factories.","Import the package registering any custom prompt kind so its init() runs.","Keep toolbox binary version aligned with the config schema version you author against."],"tags":["configuration","prompts","yaml","registry"],"backgroundTag":"unknown-config-kind","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}