{"record":{"id":"e6826d0cd8b168e9","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-e6826d","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/singlestore/singlestoreexecutesql/singlestoreexecutesql.go","lineNumber":71,"sourceCode":"type Config struct {\n\ttools.ConfigBase `yaml:\",inline\"`\n\tType             string                 `yaml:\"type\" validate:\"required\"`\n\tSource           string                 `yaml:\"source\" validate:\"required\"`\n\tAnnotations      *tools.ToolAnnotations `yaml:\"annotations,omitempty\"`\n}\n\n// validate interface\nvar _ tools.ToolConfig = Config{}\n\n// ToolConfigType returns the type of the tool configuration.\nfunc (cfg Config) ToolConfigType() string {\n\treturn resourceType\n}\n\n// Initialize sets up the Tool using the provided sources map.\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\tsqlParameter := parameters.NewStringParameter(\"sql\", \"The sql to execute.\")\n\tallParameters := parameters.Parameters{sqlParameter}\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: allParameters.Manifest(), AuthRequired: cfg.AuthRequired},\n\t\t\tallParameters,\n\t\t),\n\t}, nil\n}\n\n// validate interface\nvar _ tools.Tool = Tool{}\n","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/singlestore/singlestoreexecutesql/singlestoreexecutesql.go#L53-L89","documentation":"The singlestore-execute-sql tool's Config.Initialize returns this error when the tool's `description` field is empty. Toolbox requires every tool to have a description because it is published in the MCP manifest that LLM clients use to decide when to invoke the tool. Initialization aborts before the tool is registered, so the server fails to start (or the tool fails to load) until a description is provided.","triggerScenarios":"Declaring a `singlestore-execute-sql` tool in tools.yaml without a `description` field, or with `description: \"\"`, then starting Toolbox / loading the config.","commonSituations":"Minimal hand-written tools.yaml omitting optional-looking fields; templating that renders an empty description from a missing env var or parameter; YAML indentation errors so `description` falls under the wrong key and never reaches the Config.","solutions":["Add a non-empty `description:` field to the tool definition in tools.yaml.","Check YAML indentation so the `description` key is a direct child of the tool, not nested elsewhere.","If using env substitution for the description, verify the environment variable is set and non-empty."],"exampleFix":"# before\ntools:\n  exec-sql:\n    kind: singlestore-execute-sql\n    source: singlestore-src\n# after\ntools:\n  exec-sql:\n    kind: singlestore-execute-sql\n    source: singlestore-src\n    description: Executes arbitrary SQL against SingleStore and returns results.","handlingStrategy":"validation","validationCode":"# check every tool block has a non-empty description before starting toolbox\n# e.g. in CI:\n# yq '.tools | to_entries | map(select(.value.description == null or .value.description == \"\"))' tools.yaml","typeGuard":"func hasDescription(name, desc string) error {\n    if desc == \"\" {\n        return fmt.Errorf(\"tool %q is missing a description\", name)\n    }\n    return nil\n}","tryCatchPattern":"if err := toolbox.Start(ctx); err != nil {\n    var cfgErr *config.ConfigError // or inspect the message\n    if strings.Contains(err.Error(), \"description is required for tool\") {\n        log.Fatalf(\"config error: %v — add a description to the named tool in tools.yaml\", err)\n    }\n    log.Fatalf(\"toolbox failed to start: %v\", err)\n}","preventionTips":["Treat `description` as mandatory for every tool block, never optional.","Use a YAML schema/CI check to enforce presence of name, kind, source, and description.","Avoid env-substituting descriptions; write them literally, or fail the build when the variable is empty."],"tags":["configuration","validation","singlestore","yaml"],"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"}