{"record":{"id":"17ec6f98f77b74da","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-17ec6f","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/snowflake/snowflakesql/snowflakesql.go","lineNumber":70,"sourceCode":"\ttools.ConfigBase   `yaml:\",inline\"`\n\tType               string                 `yaml:\"type\" validate:\"required\"`\n\tSource             string                 `yaml:\"source\" validate:\"required\"`\n\tStatement          string                 `yaml:\"statement\" validate:\"required\"`\n\tParameters         parameters.Parameters  `yaml:\"parameters\"`\n\tTemplateParameters parameters.Parameters  `yaml:\"templateParameters\"`\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\tallParameters, paramManifest, err := parameters.ProcessParameters(cfg.TemplateParameters, cfg.Parameters)\n\tif err != nil {\n\t\treturn nil, err\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: paramManifest, AuthRequired: cfg.AuthRequired},\n\t\t\tallParameters,\n\t\t),\n\t}, nil\n}\n\n// validate interface","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/snowflake/snowflakesql/snowflakesql.go#L52-L88","documentation":"Config.Initialize in the snowflake-sql tool requires a non-empty description before the tool can be built. The description becomes the tool manifest shown to LLM clients; without it the tool would be unusable/undeclared, so Initialize fails fast with this error.","triggerScenarios":"Calling Initialize on a snowflake-sql Config whose ConfigBase.Description is the empty string — typically after decoding a tools.yaml entry that omits the `description` field.","commonSituations":"A tools.yaml tool entry missing `description:`; programmatically constructing Config{Name: ...} without setting Description; a YAML typo like `descriptions:` that silently decodes to empty.","solutions":["Add a `description:` field to the snowflake-sql tool entry in your YAML config.","If constructing Config in Go, set ConfigBase.Description before calling Initialize.","Validate your YAML keys (indentation, singular `description`) — an empty string passes decoding and only fails in Initialize."],"exampleFix":"// before (tools.yaml)\nmy-tool:\n  kind: snowflake-sql\n  source: my-snowflake-source\n  statement: SELECT 1\n// after\nmy-tool:\n  kind: snowflake-sql\n  source: my-snowflake-source\n  description: Runs a SQL statement against Snowflake.\n  statement: SELECT 1","handlingStrategy":"validation","validationCode":"if cfg.Description == \"\" {\n\treturn fmt.Errorf(\"tool %q is missing required field: description\", cfg.Name)\n}","typeGuard":null,"tryCatchPattern":"if err := toolInitialize(); err != nil {\n\tif strings.Contains(err.Error(), \"description is required\") {\n\t\t// add the missing description to the tool config and retry\n\t}\n\treturn err\n}","preventionTips":["Always set `description:` for every tool in tools.yaml; add a config schema/lint check.","Keep a template tools.yaml with description pre-filled.","Watch for YAML typos (`descriptions:`) that decode to an empty string silently."],"tags":["go","snowflake","config","missing-field"],"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"}