{"record":{"id":"02dea29252d9e4dc","repo":"googleapis/mcp-toolbox","slug":"unable-to-process-parameters-w-02dea2","errorCode":null,"errorMessage":"unable to process parameters: %w","messagePattern":"unable to process parameters: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/trino/trinosql/trinosql.go","lineNumber":75,"sourceCode":"\tTemplateParameters parameters.Parameters  `yaml:\"templateParameters\"`\n\tAnnotations        *tools.ToolAnnotations `yaml:\"annotations,omitempty\"`\n}\n\n// validate interface\nvar _ tools.ToolConfig = Config{}\n\nfunc (cfg Config) ToolConfigType() string {\n\treturn resourceType\n}\n\nfunc (cfg Config) Initialize(context.Context) (tools.Tool, error) {\n\tif cfg.Description == \"\" {\n\t\treturn nil, fmt.Errorf(\"description is required for tool %q\", cfg.Name)\n\t}\n\n\tallParameters, paramManifest, err := parameters.ProcessParameters(cfg.TemplateParameters, cfg.Parameters)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to process parameters: %w\", err)\n\t}\n\n\treturn Tool{\n\t\tBaseTool: tools.NewBaseTool(\n\t\t\tcfg,\n\t\t\ttools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewDestructiveAnnotations),\n\t\t\ttools.Manifest{Description: cfg.Description, Parameters: paramManifest, AuthRequired: cfg.AuthRequired},\n\t\t\tallParameters,\n\t\t),\n\t}, nil\n}\n\n// validate interface\nvar _ tools.Tool = Tool{}\n\ntype Tool struct {\n\ttools.BaseTool[Config]\n}","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/trino/trinosql/trinosql.go#L57-L93","documentation":"trino-sql's Initialize calls parameters.ProcessParameters on its templateParameters and parameters; if processing fails (invalid parameter definitions, duplicate names, bad types), the error is wrapped with this message. It means the tool's parameter configuration could not be converted into runtime parameter objects.","triggerScenarios":"Initializing a trino-sql tool whose `templateParameters` or `parameters` lists contain invalid entries — e.g. missing name/type, unsupported type, duplicate parameter names, or otherwise malformed parameter specs.","commonSituations":"Misspelled parameter type names; duplicate parameter keys in the YAML; a template parameter referenced in `statement` but defined incorrectly; copy-pasted parameter blocks with clashing names.","solutions":["Read the wrapped cause below this message for the specific parameter problem","Fix the invalid parameter entry (name, type, description) in the tool config","Remove or rename duplicate parameter names","Ensure every parameter type is one supported by parameters.ProcessParameters"],"exampleFix":"// before (tools.yaml)\ntrino_query:\n  kind: trino-sql\n  parameters:\n    - name: limit\n      type: integerr\n// after\ntrino_query:\n  kind: trino-sql\n  parameters:\n    - name: limit\n      type: integer\n      description: Max rows to return.","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"string\": true, \"integer\": true, \"boolean\": true, \"float\": true, \"array\": true}\nfor _, p := range cfg[\"parameters\"].([]map[string]any) {\n    if !allowed[p[\"type\"].(string)] {\n        return fmt.Errorf(\"parameter %q has unsupported type %q\", p[\"name\"], p[\"type\"])\n    }\n}","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), \"unable to process parameters\") {\n        return fmt.Errorf(\"fix parameter definitions: %w\", err)\n    }\n    return err\n}","preventionTips":["Use documented parameter types only","Ensure parameter names are unique within a tool","Reference parameters in the statement only after defining them correctly","Smoke-test the config locally before deploying"],"tags":["go","parameters","trino","validation"],"backgroundTag":"invalid-param-definition","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"}