{"record":{"id":"f29c103ffde9adce","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-f29c10","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/snowflakeexecutesql/snowflakeexecutesql.go","lineNumber":67,"sourceCode":"}\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\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\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\n// validate interface\nvar _ tools.Tool = Tool{}\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/snowflake/snowflakeexecutesql/snowflakeexecutesql.go#L49-L85","documentation":"The snowflake-execute-sql tool's Config.Initialize returns this error when the tool's `description` field is empty. Toolbox mandates a description for every tool because it is exposed to MCP clients in the tool manifest; initialization of the tool fails and it will not be registered until a non-empty description is supplied. The message includes the tool's configured name for quick identification in tools.yaml.","triggerScenarios":"A `snowflake-execute-sql` tool entry in tools.yaml lacking a `description` field or containing `description: \"\"` when the config is loaded and Initialize runs.","commonSituations":"Writing minimal snowflake examples that omit description; environment-variable interpolation yielding an empty string; YAML nesting mistakes placing description outside the tool's mapping.","solutions":["Add a non-empty `description:` to the snowflake-execute-sql tool definition.","Correct YAML indentation so description belongs to the tool mapping.","If the description is injected via env/templating, confirm the variable is set before launching Toolbox."],"exampleFix":"# before\ntools:\n  sf-exec:\n    kind: snowflake-execute-sql\n    source: snowflake-src\n# after\ntools:\n  sf-exec:\n    kind: snowflake-execute-sql\n    source: snowflake-src\n    description: Execute a SQL statement against Snowflake and return the results.","handlingStrategy":"validation","validationCode":"tools:\n  sf-exec:\n    kind: snowflake-execute-sql\n    source: snowflake-src\n    description: \"Execute SQL on Snowflake\"  # must be non-empty","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    if strings.Contains(err.Error(), \"description is required for tool\") {\n        log.Fatalf(\"add missing description for the named tool: %v\", err)\n    }\n    log.Fatalf(\"startup failed: %v\", err)\n}","preventionTips":["Always set description for snowflake-* tools in tools.yaml.","Fail CI fast when env-var-interpolated descriptions resolve to empty strings.","Keep tool blocks with all required fields (name, kind, source, description) in your scaffolding templates."],"tags":["configuration","validation","snowflake","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"}