{"record":{"id":"ccf561a2915cb843","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-ccf561","errorCode":null,"errorMessage":"description is required for tool %q","messagePattern":"description is required for tool %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/redis/redis.go","lineNumber":68,"sourceCode":"type Config struct {\n\ttools.ConfigBase `yaml:\",inline\"`\n\tType             string                 `yaml:\"type\" validate:\"required\"`\n\tSource           string                 `yaml:\"source\" validate:\"required\"`\n\tCommands         [][]string             `yaml:\"commands\" validate:\"required\"`\n\tParameters       parameters.Parameters  `yaml:\"parameters\"`\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\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: cfg.Parameters.Manifest(), AuthRequired: cfg.AuthRequired},\n\t\t\tcfg.Parameters,\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":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/redis/redis.go#L50-L86","documentation":"The redis tool's Initialize returns this error when the tool's `description` field is empty in tools.yaml. Every tool requires a human-readable description because it is surfaced to the LLM as the tool's manifest description, letting the model decide when to invoke the tool.","triggerScenarios":"Calling Initialize during server startup for a `kind: redis` tool whose YAML entry omits the `description:` field or sets it to an empty string.","commonSituations":"Hand-writing a redis tool entry and forgetting the description; config generators emitting empty descriptions; YAML indentation placing `description` under the wrong key so it never binds.","solutions":["Add a non-empty `description:` field to the redis tool entry in tools.yaml","Check YAML indentation so `description` is a sibling of `kind`, `source`, and `commands`","Validate the config with the toolbox binary before deploying"],"exampleFix":"# before\nmy-redis-tool:\n  kind: redis\n  source: redis-src\n  commands: [[\"PING\"]]\n# after\nmy-redis-tool:\n  kind: redis\n  source: redis-src\n  description: Runs the given Redis commands and returns the results.\n  commands: [[\"PING\"]]","handlingStrategy":"validation","validationCode":"// pre-validate the redis tool entry before handing it to the toolbox\nvar check struct {\n\tDescription string `yaml:\"description\"`\n}\nif err := yaml.Unmarshal(rawToolYAML, &check); err != nil || check.Description == \"\" {\n\treturn fmt.Errorf(\"redis tool %q: description is required and must be non-empty\", toolName)\n}","typeGuard":null,"tryCatchPattern":"if err := server.Start(ctx); err != nil {\n\tif strings.Contains(err.Error(), \"description is required\") {\n\t\tlog.Fatalf(\"config error: every tool needs a non-empty description; failing entry: %v\", err)\n\t}\n\treturn err\n}","preventionTips":["Always include a meaningful `description:` for every redis tool entry","Use prebuilt redis tool configs as templates that already contain descriptions","Run `toolbox --tools-file tools.yaml` as a CI check before deploy","Check YAML indentation so `description` is a top-level tool field"],"tags":["go","config","validation","missing-field","redis"],"backgroundTag":"missing-required-argument","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"}