{"record":{"id":"0b88e33f90935ee8","repo":"googleapis/mcp-toolbox","slug":"fail-to-get-map-params-w","errorCode":null,"errorMessage":"fail to get map params: %w","messagePattern":"fail to get map params: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/bigtable/bigtable.go","lineNumber":171,"sourceCode":"\t\t\t}\n\t\t\tbtParamTypes[p.GetName()] = bigtable.ArraySQLType{\n\t\t\t\tElemType: itemType,\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tparamType, err := getBigtableType(p.GetType())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbtParamTypes[p.GetName()] = paramType\n\t}\n\treturn btParamTypes, nil\n}\n\nfunc (s *Source) RunSQL(ctx context.Context, statement string, configParam parameters.Parameters, params parameters.ParamValues) (any, error) {\n\tmapParamsType, err := getMapParamsType(configParam)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"fail to get map params: %w\", err)\n\t}\n\n\tps, err := s.BigtableClient().PrepareStatement(\n\t\tctx,\n\t\tstatement,\n\t\tmapParamsType,\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to prepare statement: %w\", err)\n\t}\n\n\tbs, err := ps.Bind(params.AsMap())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to bind: %w\", err)\n\t}\n\n\tout := []any{}\n\tvar rowErr error","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/bigtable/bigtable.go#L153-L189","documentation":"RunSQL wraps any failure from getMapParamsType (which translates the tool's declared parameter types into Bigtable SQLTypes) with this message. The root cause is virtually always error 511 — an unsupported or misspelled parameter type — so the wrapped error names the offending type. It fires before any statement is sent to Bigtable.","triggerScenarios":"RunSQL is invoked with a `configParam` (parameters.Parameters) containing a param whose type or array items.type is not boolean/string/integer/float/array; getMapParamsType returns an error which is wrapped here.","commonSituations":"Tool config declares `type: number` or `type: object` for a parameter used by a Bigtable execute_sql tool; nested array item type unsupported; typo'd type in tools.yaml discovered only at query time.","solutions":["Read the wrapped error to find the offending type name and fix the tool parameter type to boolean/string/integer/float/array","Fix the array parameter's items.type if the failing param is an array","Validate the tool config before deploying (declare only supported types for Bigtable-backed tools)"],"exampleFix":"// before (tools.yaml)\nparameters:\n  - name: filters\n    type: object\n// after\nparameters:\n  - name: filter_value\n    type: string","handlingStrategy":"validation","validationCode":"for _, p := range toolParams {\n\tt := p.GetType()\n\tif t != \"boolean\" && t != \"string\" && t != \"integer\" && t != \"float\" && t != \"array\" {\n\t\treturn fmt.Errorf(\"param %q type %q unsupported before calling RunSQL\", p.GetName(), t)\n\t}\n}","typeGuard":null,"tryCatchPattern":"res, err := src.RunSQL(ctx, statement, cfgParams, paramValues)\nif err != nil {\n\tvar target *bigtableSrcErr\n\tif strings.Contains(err.Error(), \"fail to get map params\") {\n\t\t// unwrap to find the offending type in the tool config\n\t}\n\treturn err\n}","preventionTips":["Validate all tool parameter types when authoring tools.yaml for bigtable sources","Keep array item types within the supported set","Smoke-test each tool's RunSQL path in CI","Read the wrapped 'unknow param type' error to identify the exact bad type"],"tags":["bigtable","parameters","type-mapping"],"backgroundTag":"unsupported-parameter-type","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"}