{"record":{"id":"4509a4834c1d0b39","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-4509a4","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/mindsdb/mindsdbexecutesql/mindsdbexecutesql.go","lineNumber":66,"sourceCode":"\tRunSQL(context.Context, string, []any) (any, error)\n}\n\ntype 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\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\tsqlParameter := parameters.NewStringParameter(\"sql\", \"The sql to execute.\")\n\tparams := 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: params.Manifest(), AuthRequired: cfg.AuthRequired},\n\t\t\tparams,\n\t\t),\n\t}, nil\n}\n\nvar _ tools.Tool = Tool{}\n\ntype Tool struct {","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/mindsdb/mindsdbexecutesql/mindsdbexecutesql.go#L48-L84","documentation":"Config.Initialize for mindsdb-execute-sql validates that the tool has a non-empty description before building the tool. The description is what is exposed to LLM clients via the MCP manifest, so an empty one is treated as invalid configuration and tool creation fails immediately.","triggerScenarios":"Declaring a tool with kind `mindsdb-execute-sql` in tools.yaml where the `description` field is missing or set to an empty string, then loading the config (Initialize is called during toolbox startup).","commonSituations":"Hand-writing a tools.yaml and omitting description; templating tools programmatically and leaving the description field empty; deleting a description during a config cleanup.","solutions":["Add a non-empty `description` field to the tool entry in tools.yaml","If generating configs programmatically, validate that description is non-empty before calling Initialize","Run the toolbox config load locally to catch this before deployment"],"exampleFix":"// before (tools.yaml)\nexecute-sql:\n  kind: mindsdb-execute-sql\n  source: my-mindsdb\n// after\nexecute-sql:\n  kind: mindsdb-execute-sql\n  source: my-mindsdb\n  description: Execute SQL statements against MindsDB.","handlingStrategy":"validation","validationCode":"if cfg.Name != \"\" && cfg.Description == \"\" {\n    return fmt.Errorf(\"tool %q: description must be non-empty\", cfg.Name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include a description when adding a tool entry","Lint tools.yaml for required fields (name, kind, source, description) in CI","If generating configs, template the description as a required value"],"tags":["go","mindsdb","config-validation","missing-field"],"backgroundTag":"missing-tool-description","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"}