{"record":{"id":"7cc9f15191f6d0ac","repo":"googleapis/mcp-toolbox","slug":"unable-to-parse-value-for-key-q-w","errorCode":null,"errorMessage":"unable to parse value for key %q: %w","messagePattern":"unable to parse value for key %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/util/parameters/parameters.go","lineNumber":1365,"sourceCode":"\t\t}\n\t\tconvertedMap, ok := convertedData.(map[string]any)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"internal error: ConvertNumbers should return a map, but got type %T\", convertedData)\n\t\t}\n\t\treturn convertedMap, nil\n\t}\n\n\t// Otherwise, get a prototype and parse each value in the map.\n\tprototype, err := getPrototypeParameter(p.ValueType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trtn := make(map[string]any, len(m))\n\tfor key, val := range m {\n\t\tparsedVal, err := prototype.Parse(val)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse value for key %q: %w\", key, err)\n\t\t}\n\t\trtn[key] = parsedVal\n\t}\n\treturn rtn, nil\n}\n\nfunc (p *MapParameter) GetAuthServices() []ParamAuthService {\n\treturn p.AuthServices\n}\n\nfunc (p *MapParameter) GetDefault() any {\n\tif p.Default == nil {\n\t\treturn nil\n\t}\n\treturn *p.Default\n}\n\nfunc (p *MapParameter) GetValueType() string {","sourceCodeStart":1347,"sourceCodeEnd":1383,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/util/parameters/parameters.go#L1347-L1383","documentation":"MapParameter.Parse iterates the map's entries and parses each value with a prototype parameter derived from valueType. This wrapping error fires at tool invocation time when one entry's value fails prototype parsing (e.g. wrong scalar type); the failing map key is named in the message and the cause is carried via %w.","triggerScenarios":"Thrown at internal/util/parameters/parameters.go:1365 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped cause to see why the value for the named key failed to parse","Ensure each map value matches the parameter's valueType","Correct or remove the offending key/value pair from the invocation arguments"],"exampleFix":null,"handlingStrategy":"try-catch","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"}