{"record":{"id":"9da45b73c7ed0877","repo":"googleapis/mcp-toolbox","slug":"tool-q-config-error-parameter-q-index-d-refe","errorCode":null,"errorMessage":"tool %q config error: parameter %q (index %d) references '%q' in the 'valueFromParam' field, which is not a defined parameter","messagePattern":"tool %q config error: parameter %q \\(index (.+?)\\) references '%q' in the 'valueFromParam' field, which is not a defined parameter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/server/config.go","lineNumber":515,"sourceCode":"\t\t\t\t\t\tvalidParamNames[pName] = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Validate references\n\t\t\tfor i, rawP := range paramsList {\n\t\t\t\tpMap, ok := rawP.(map[string]any)\n\t\t\t\tif !ok {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tpName, _ := pMap[\"name\"].(string)\n\t\t\t\trefName, _ := pMap[\"valueFromParam\"].(string)\n\n\t\t\t\tif refName != \"\" {\n\t\t\t\t\t// Check if the referenced parameter exists\n\t\t\t\t\tif !validParamNames[refName] {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"tool %q config error: parameter %q (index %d) references '%q' in the 'valueFromParam' field, which is not a defined parameter\", name, pName, i, refName)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check for self-reference\n\t\t\t\t\tif refName == pName {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"tool %q config error: parameter %q cannot copy value from itself\", name, pName)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdec, err := util.NewStrictDecoder(r)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating decoder: %s\", err)\n\t}\n\ttoolCfg, err := tools.DecodeConfig(ctx, resourceType, name, dec)\n\tif err != nil {\n\t\tif errors.Is(err, tools.ErrUnknownToolType) && util.IgnoreUnknownToolsFromContext(ctx) {","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/config.go#L497-L533","documentation":"A tool parameter uses `valueFromParam` to copy the value of another parameter, but the referenced name is not defined anywhere in the tool's `parameters` list. The parser builds a set of all parameter names first and fails fast on dangling references.","triggerScenarios":"A tools entry has a parameter with `valueFromParam: <name>` where <name> is not any parameter's `name` in the same tool — e.g. a typo, a reference to a parameter that was deleted, or referencing an authClaim/nested field instead of a sibling parameter.","commonSituations":"Renaming a parameter without updating valueFromParam references; copying parameter blocks between tools; assuming built-in or implicit parameters can be referenced.","solutions":["Fix the valueFromParam string to exactly match an existing parameter's name in the same tool","Add the referenced parameter to the parameters list if it should exist","Remove the valueFromParam field if the copy is no longer needed"],"exampleFix":"// before\nparameters:\n  - name: user_id\n    type: string\n  - name: effective_id\n    type: string\n    valueFromParam: userId\n// after\nparameters:\n  - name: user_id\n    type: string\n  - name: effective_id\n    type: string\n    valueFromParam: user_id","handlingStrategy":"validation","validationCode":"func validateParamRefs(params []map[string]any) error {\n  names := map[string]bool{}\n  for _, p := range params { if n, ok := p[\"name\"].(string); ok { names[n] = true } }\n  for _, p := range params {\n    if ref, ok := p[\"valueFromParam\"].(string); ok && ref != \"\" && !names[ref] {\n      return fmt.Errorf(\"valueFromParam %q is not a defined parameter\", ref)\n    }\n  }\n  return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Grep valueFromParam references against parameter names whenever renaming parameters","Only reference sibling parameters in the same tool","Add this validation to a pre-commit config linter"],"tags":["config","tools","parameters","validation"],"backgroundTag":"invalid-parameter-reference","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"}