{"record":{"id":"ead971fc5b4cafa5","repo":"googleapis/mcp-toolbox","slug":"s-is-not-an-allowed-escaping-delimiter","errorCode":null,"errorMessage":"%s is not an allowed escaping delimiter","messagePattern":"(.+?) is not an allowed escaping delimiter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/util/parameters/parameters.go","lineNumber":726,"sourceCode":"\treturn newV, nil\n}\n\nfunc applyEscape(escape, v string) (any, error) {\n\tswitch escape {\n\tcase escapeBackticks:\n\t\tescaped := strings.ReplaceAll(v, \"`\", \"``\")\n\t\treturn fmt.Sprintf(\"`%s`\", escaped), nil\n\tcase escapeDoubleQuotes:\n\t\tescaped := strings.ReplaceAll(v, `\"`, `\"\"`)\n\t\treturn fmt.Sprintf(`\"%s\"`, escaped), nil\n\tcase escapeSingleQuotes:\n\t\tescaped := strings.ReplaceAll(v, `'`, `''`)\n\t\treturn fmt.Sprintf(`'%s'`, escaped), nil\n\tcase escapeSquareBrackets:\n\t\tescaped := strings.ReplaceAll(v, \"]\", \"]]\")\n\t\treturn fmt.Sprintf(\"[%s]\", escaped), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%s is not an allowed escaping delimiter\", escape)\n\t}\n}\n\nfunc (p *StringParameter) GetAuthServices() []ParamAuthService {\n\treturn p.AuthServices\n}\n\nfunc (p *StringParameter) GetDefault() any {\n\tif p.Default == nil {\n\t\treturn nil\n\t}\n\treturn *p.Default\n}\n\n// Manifest returns the manifest for the StringParameter.\nfunc (p *StringParameter) Manifest() ParameterManifest {\n\t// only list ParamAuthService names (without fields) in manifest\n\tauthServiceNames := getAuthServiceNames(p.AuthServices)","sourceCodeStart":708,"sourceCodeEnd":744,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/util/parameters/parameters.go#L708-L744","documentation":"This error is thrown by StringParameter's applyEscape helper when the parameter's configured 'escape' string does not match one of the four supported escaping delimiters (backticks, double quotes, single quotes, square brackets). It means the tools.yaml (or programmatic parameter config) specified an invalid escape mode, so the toolbox refuses to safely quote/escape the string value. It is a configuration error, not a data error — the value itself is fine, but the library cannot pick a quoting strategy.","triggerScenarios":"A StringParameter was declared with an 'escape' field (via yaml 'escape:' or WithStringEscape option) whose value is not exactly one of: backticks ('`'), doubleQuotes ('\"'), singleQuotes (\"'\"), or squareBrackets ('[]'). E.g. escape: quotes, escape: bracket, escape: 'brackets', or a typo like escape: square_bracket.","commonSituations":"Hand-editing tools.yaml and guessing the escape mode name; migrating tool configs between toolbox versions where the accepted keyword set changed; AI/agent-generated configs inventing plausible-looking escape names; copying an escape value from another tool's config that used a different quoting convention.","solutions":["Open your tools.yaml (or the WithStringEscape call) and set escape to exactly one of the allowed delimiters: backticks, doubleQuotes, singleQuotes, squareBrackets","If you only need literal string substitution without quoting, remove the escape field entirely","Check the version you are running against: older releases may only support a subset of delimiters; upgrade or downgrade to match your config","Write a quick unit/config test that parses all tools.yaml files at CI time to catch invalid escape values before deployment"],"exampleFix":"# before\nparameters:\n  - name: my_id\n    type: string\n    escape: brackets\n# after\nparameters:\n  - name: my_id\n    type: string\n    escape: squareBrackets","handlingStrategy":"validation","validationCode":"var allowedEscapes = map[string]bool{\"backticks\": true, \"doubleQuotes\": true, \"singleQuotes\": true, \"squareBrackets\": true}\nfunc validateEscape(escape string) error {\n    if escape != \"\" && !allowedEscapes[escape] {\n        return fmt.Errorf(\"escape %q must be one of backticks, doubleQuotes, singleQuotes, squareBrackets\", escape)\n    }\n    return nil\n}","typeGuard":"func isAllowedEscape(s string) bool {\n    switch s {\n    case \"backticks\", \"doubleQuotes\", \"singleQuotes\", \"squareBrackets\":\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Only use the documented escape keywords: backticks, doubleQuotes, singleQuotes, squareBrackets","Validate all tools.yaml parameter definitions in CI before deploying","Omit the escape field when no quoting is needed","Pin and read the docs for the toolbox version you deploy, since accepted keywords can change"],"tags":["go","configuration","parameters","escaping"],"backgroundTag":"invalid-config-value","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"}