{"record":{"id":"d31dcb13b2b9ccad","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-d31dcb","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/clickhouse/clickhousesql/clickhousesql.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\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\nvar _ tools.ToolConfig = Config{}\n\nfunc (cfg Config) ToolConfigType() string {\n\treturn sqlType\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\nvar _ tools.Tool = Tool{}","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/clickhouse/clickhousesql/clickhousesql.go#L50-L86","documentation":"Config.Initialize for clickhouse-sql (the raw execute-SQL tool) enforces a non-empty `description`, which the toolbox sends to LLM clients as the tool's manifest description. Missing descriptions are rejected during config load, before any request is served.","triggerScenarios":"A `clickhouse-sql` tool entry in YAML with no `description` key/empty value, or Go code (tests like TestFailInitialization) building a Config with an empty Description and calling Initialize.","commonSituations":"Omitting optional-looking fields in handwritten configs; template rendering that blanks the description; typos in the YAML key.","solutions":["Add a non-empty `description` describing what SQL the tool runs and any constraints.","Fix YAML key/indentation issues so Description parses.","Set Description in the Config struct before Initialize in programmatic use."],"exampleFix":"// before\ntools:\n  run_sql:\n    source: ch\n// after\ntools:\n  run_sql:\n    source: ch\n    description: Execute a read-only SQL query against ClickHouse.","handlingStrategy":"validation","validationCode":"// Go\nif strings.TrimSpace(cfg.Description) == \"\" {\n    return errors.New(\"clickhouse-sql tool requires a description\")\n}\ntool, err := cfg.Initialize(context.Background())","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write descriptions that also state safety constraints (e.g. read-only SQL).","Add a config schema check rejecting empty description fields.","Catch this in tests by initializing all configs from your YAML."],"tags":["clickhouse","config-validation","missing-field","tool-config"],"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"}