{"record":{"id":"5c784190faab3377","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-5c7841","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/clickhouseexecutesql/clickhouseexecutesql.go","lineNumber":64,"sourceCode":"\tRunSQL(context.Context, string, parameters.ParamValues) (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 executeSQLType\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 statement 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":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/clickhouse/clickhouseexecutesql/clickhouseexecutesql.go#L46-L82","documentation":"This error is thrown by the clickhouseexecutesql tool's Config.Initialize when the tool config's Description is empty. A non-empty description is required for the MCP tool manifest, so the tool fails to initialize and is excluded from the server.","triggerScenarios":"Calling Initialize on a clickhouseexecutesql Config with Description == \"\" — e.g. a tools.yaml entry of kind clickhouse-execute-sql missing the description key or with an empty value after expansion.","commonSituations":"Hand-written tools.yaml without description; templated description variables resolving to empty; YAML indentation placing description outside the tool block; copied snippets omitting the field.","solutions":["Add a non-empty description field to the clickhouse-execute-sql tool in tools.yaml","Ensure any env/template substitution for description produces a non-empty string","Correct YAML nesting so description belongs to the tool","Restart the server and verify the tool registers"],"exampleFix":"// before (tools.yaml)\ntools:\n  clickhouse-sql:\n    kind: clickhouse-execute-sql\n    source: my-clickhouse\n// after\ntools:\n  clickhouse-sql:\n    kind: clickhouse-execute-sql\n    source: my-clickhouse\n    description: Executes a SQL statement against ClickHouse.","handlingStrategy":"validation","validationCode":"// Validate before constructing the tool\ncfg := clickhouseexecutesql.Config{Name: \"clickhouse-sql\", Source: \"my-clickhouse\"}\nif strings.TrimSpace(cfg.Description) == \"\" {\n    return fmt.Errorf(\"tool %q requires a non-empty description\", cfg.Name)\n}\n// Or lint the YAML: tools[\"clickhouse-sql\"].description must be present and non-empty","typeGuard":"func hasDescription(name, desc string) bool {\n    return strings.TrimSpace(desc) != \"\"\n}","tryCatchPattern":null,"preventionTips":["Always set description for clickhouse-execute-sql tools","Lint tools.yaml in CI for required non-empty fields","Beware empty env substitutions for description values","Run the toolbox locally to confirm all tools initialize before deploy"],"tags":["go","config","validation","clickhouse"],"backgroundTag":"missing-required-tool-field","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"}