googleapis/mcp-toolbox · error
parameter %q cannot have both 'secure' set to true and 'requ
Error message
parameter %q cannot have both 'secure' set to true and 'required' set to false
What it means
validateParameter enforces a constraint on secure parameters: a 'secure' parameter (value hidden/redacted) must always be required, because an omitted secure value has no safe fallback. The error fires during config parsing when a parameter entry in tools.yaml sets secure: true together with required: false.
Source
Thrown at internal/util/parameters/parameters.go:340
paramManifest := allParameters.Manifest()
if paramManifest == nil {
paramManifest = make([]ParameterManifest, 0)
}
return allParameters, paramManifest, nil
}
// validateParameter validates that parameter configuration adheres to system constraints.
func validateParameter(p Parameter) error {
if p.GetSecure() {
if len(p.GetAuthServices()) > 0 {
return fmt.Errorf("parameter %q cannot have both 'secure' set to true and 'authServices' specified", p.GetName())
}
if p.GetDefault() != nil {
return fmt.Errorf("parameter %q cannot have both 'secure' set to true and 'default' specified", p.GetName())
}
if !p.GetRequired() {
return fmt.Errorf("parameter %q cannot have both 'secure' set to true and 'required' set to false", p.GetName())
}
}
return nil
}
type Parameter interface {
// Note: It's typically not idiomatic to include "Get" in the function name,
// but this is done to differentiate it from the fields in CommonParameter.
GetName() string
GetDesc() string
GetType() string
GetDefault() any
GetRequired() bool
GetAuthServices() []ParamAuthService
GetEmbeddedBy() string
GetValueFromParam() string
Parse(any) (any, error)
Manifest() ParameterManifestView on GitHub (pinned to 8cc6e09de2)
Solutions
- Set 'required: true' on the secure parameter
- Remove 'secure: true' if the parameter is genuinely optional and not sensitive
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/util/parameters/parameters.go:340 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/c7efb2c94c08b93e.
Report an issue: GitHub.