{"record":{"id":"dd1add975c3ebcab","repo":"googleapis/mcp-toolbox","slug":"error-getting-parameters-for-tool-w","errorCode":null,"errorMessage":"error getting parameters for tool: %w","messagePattern":"error getting parameters for tool: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/internal/invoke/command.go","lineNumber":119,"sourceCode":"\t}\n\n\tvar paramsInput string\n\tif len(args) > 1 {\n\t\tparamsInput = args[1]\n\t}\n\n\tparams := make(map[string]any)\n\tif paramsInput != \"\" {\n\t\tif err := util.DecodeJSON(strings.NewReader(paramsInput), &params); err != nil {\n\t\t\terrMsg := fmt.Errorf(\"params must be a valid JSON string: %w\", err)\n\t\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\t\treturn errMsg\n\t\t}\n\t}\n\n\ttoolParams, err := tool.GetParameters(src)\n\tif err != nil {\n\t\terrMsg := fmt.Errorf(\"error getting parameters for tool: %w\", err)\n\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\treturn errMsg\n\t}\n\n\tparsedParams, err := parameters.ParseParams(toolParams, params, nil)\n\tif err != nil {\n\t\terrMsg := fmt.Errorf(\"invalid parameters: %w\", err)\n\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\treturn errMsg\n\t}\n\n\tparsedParams, err = tool.EmbedParams(ctx, parsedParams, primitiveMgr)\n\tif err != nil {\n\t\terrMsg := fmt.Errorf(\"error embedding parameters: %w\", err)\n\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\treturn errMsg\n\t}\n","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/cmd/internal/invoke/command.go#L101-L137","documentation":"Thrown by runInvoke (cmd/internal/invoke/command.go:119) when tool.GetParameters(src) returns an error while resolving the tool's parameter schema (its MCP inputSchema definitions) for the bound source. It means the tool definition itself is broken — e.g. its underlying parameter manifest cannot be built — not that the user-supplied params are wrong. The CLI aborts before parsing user params.","triggerScenarios":"Calling `toolbox invoke <tool> ...` for a tool whose GetParameters fails: a tool config with malformed/missing `parameters` YAML entries, a template/lookup in a parameter that references a missing resource, or a source-dependent schema resolution failure.","commonSituations":"Hand-edited tools.yaml with a bad parameter definition (wrong type, missing name/description fields), a prebuilt config mismatched with the configured source kind, or upgrading toolbox while keeping an old tools.yaml with fields that no longer parse.","solutions":["Run `toolbox serve` or `toolbox --tools-file` validation to see the underlying parameter schema error in the config.","Inspect the wrapped error message for the offending parameter name in your tools YAML and fix its fields (name, type, description, required).","Compare your tool definition against the canonical pattern (e.g. internal/tools/postgres/postgressql) or the prebuilt config for that source.","Update the tools file to the schema expected by your installed toolbox version (check release notes for breaking changes)."],"exampleFix":"# before (tools.yaml)\ntools:\n  my-tool:\n    kind: postgres-sql\n    parameters:\n      - type: string\n# after (name is required)\ntools:\n  my-tool:\n    kind: postgres-sql\n    parameters:\n      - name: query\n        type: string\n        description: SQL to execute","handlingStrategy":"validation","validationCode":"// Start the server once to surface config/schema errors before invoking:\n// toolbox serve --tools-file tools.yaml --prebuilt postgres\n// Any bad parameter definition fails at startup with a precise message.","typeGuard":null,"tryCatchPattern":"if err := runInvoke(...); err != nil {\n  if strings.Contains(err.Error(), \"error getting parameters for tool\") {\n    log.Fatalf(\"tool config invalid: %v\", err)\n  }\n}","preventionTips":["Validate tools.yaml at CI time by starting `toolbox serve` in a smoke test.","Keep parameter definitions complete: name, type, description are all required.","Pin the toolbox version and re-validate the tools file after upgrades."],"tags":["cli","tool-config","parameters"],"backgroundTag":"tool-parameter-schema-error","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"}