{"record":{"id":"feee0ae3897124ad","repo":"googleapis/mcp-toolbox","slug":"invalid-type-field-for-prompt-q-must-be-a-stri","errorCode":null,"errorMessage":"invalid 'type' field for prompt %q (must be a string)","messagePattern":"invalid 'type' field for prompt %q \\(must be a string\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/server/config.go","lineNumber":588,"sourceCode":"\t\treturn group.GroupConfig{}, fmt.Errorf(\"unable to unmarshal group: %s\", err)\n\t}\n\t// The default (nameless) group always contains all configured tools and\n\t// prompts, so it may only set a description.\n\tif name == \"\" && (len(gc.ToolNames) > 0 || len(gc.PromptNames) > 0) {\n\t\treturn group.GroupConfig{}, fmt.Errorf(\"the default (nameless) group cannot declare 'tools' or 'prompts'; it always contains all configured tools and prompts\")\n\t}\n\treturn gc, nil\n}\n\nfunc UnmarshalYAMLPromptConfig(ctx context.Context, name string, r map[string]any) (prompts.PromptConfig, error) {\n\t// Look for the 'type' field. If it's not present, typeStr will be an\n\t// empty string, which prompts.DecodeConfig will correctly default to \"custom\".\n\tvar resourceType string\n\tif typeVal, ok := r[\"type\"]; ok {\n\t\tvar isString bool\n\t\tresourceType, isString = typeVal.(string)\n\t\tif !isString {\n\t\t\treturn nil, fmt.Errorf(\"invalid 'type' field for prompt %q (must be a string)\", name)\n\t\t}\n\t}\n\tdec, err := util.NewStrictDecoder(r)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating decoder: %s\", err)\n\t}\n\n\t// Use the central registry to decode the prompt based on its type.\n\tpromptCfg, err := prompts.DecodeConfig(ctx, resourceType, name, dec)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn promptCfg, nil\n}\n\n// Tools naming validation is added in the MCP v2025-11-25, but we'll be\n// implementing it across Toolbox\n// Tool names SHOULD be between 1 and 128 characters in length (inclusive).","sourceCodeStart":570,"sourceCodeEnd":606,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/config.go#L570-L606","documentation":"Error \"invalid 'type' field for prompt %q (must be a string)\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/server/config.go:588 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"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"}