{"record":{"id":"1599d200f3a67890","repo":"googleapis/mcp-toolbox","slug":"q-is-not-valid-type-for-a-parameter","errorCode":null,"errorMessage":"%q is not valid type for a parameter","messagePattern":"%q is not valid type for a parameter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/util/parameters/parameters.go","lineNumber":472,"sourceCode":"\t\ta := &ArrayParameter{}\n\t\tif err := dec.DecodeContext(ctx, a); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse as %q: %w\", paramType, err)\n\t\t}\n\t\tif a.GetEmbeddedBy() != \"\" {\n\t\t\treturn nil, fmt.Errorf(\"parameter type %q cannot specify 'embeddedBy'\", paramType)\n\t\t}\n\t\treturn a, nil\n\tcase TypeMap:\n\t\ta := &MapParameter{}\n\t\tif err := dec.DecodeContext(ctx, a); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse as %q: %w\", paramType, err)\n\t\t}\n\t\tif a.GetEmbeddedBy() != \"\" {\n\t\t\treturn nil, fmt.Errorf(\"parameter type %q cannot specify 'embeddedBy'\", paramType)\n\t\t}\n\t\treturn a, nil\n\t}\n\treturn nil, fmt.Errorf(\"%q is not valid type for a parameter\", paramType)\n}\n\nfunc (ps Parameters) Manifest() []ParameterManifest {\n\trtn := make([]ParameterManifest, 0, len(ps))\n\tfor _, p := range ps {\n\t\tif p.GetValueFromParam() != \"\" {\n\t\t\tcontinue\n\t\t}\n\t\trtn = append(rtn, p.Manifest())\n\t}\n\treturn rtn\n}\n\n// ParameterManifest represents parameters when served as part of a ToolManifest.\ntype ParameterManifest struct {\n\tName                 string             `json:\"name\"`\n\tType                 string             `json:\"type\"`\n\tRequired             bool               `json:\"required\"`","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/util/parameters/parameters.go#L454-L490","documentation":"This error is thrown at the fall-through of the parameter type switch in ParseParameter (internal/util/parameters/parameters.go:472): the 'type' field supplied for a tool parameter does not match any of the supported kinds (string, integer, boolean, array, map, float). It is a generic validation guard — the switch exhausted every known case, so the offending input is the paramType string read from the YAML/JSON tool configuration.","triggerScenarios":"Thrown at internal/util/parameters/parameters.go:472 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the 'type' field of the failing parameter in the tool definition YAML and correct typos such as 'str', 'int', 'bools', or 'arrays' to the supported values: string, integer, boolean, array, map, float","Verify you are using a supported parameter type; nested object parameters are not supported — model them as a 'map' type or separate parameters","Ensure the type key is a plain scalar string and not accidentally a nested mapping or list in the YAML"],"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"}