{"record":{"id":"f65d4fa0ee9e40fd","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-f65d4f","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/cassandra/cassandracql/cassandracql.go","lineNumber":71,"sourceCode":"\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\n// ToolConfigType implements tools.ToolConfig.\nfunc (c Config) ToolConfigType() string {\n\treturn resourceType\n}\n\n// Initialize implements tools.ToolConfig.\nfunc (c Config) Initialize(context.Context) (tools.Tool, error) {\n\tif c.Description == \"\" {\n\t\treturn nil, fmt.Errorf(\"description is required for tool %q\", c.Name)\n\t}\n\n\tallParameters, paramManifest, err := parameters.ProcessParameters(c.TemplateParameters, c.Parameters)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn Tool{\n\t\tBaseTool: tools.NewBaseTool(\n\t\t\tc,\n\t\t\ttools.GetAnnotationsOrDefault(c.Annotations, tools.NewDestructiveAnnotations),\n\t\t\ttools.Manifest{Description: c.Description, Parameters: paramManifest, AuthRequired: c.AuthRequired},\n\t\t\tallParameters,\n\t\t),\n\t}, nil\n}\n\nvar _ tools.Tool = Tool{}","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cassandra/cassandracql/cassandracql.go#L53-L89","documentation":"This error is thrown by the cassandracql tool's Config.Initialize when the tool config has an empty Description. Every MCP tool requires a description for the LLM-facing manifest, so initialization aborts and the tool is not registered.","triggerScenarios":"Calling Initialize on a cassandracql Config with Description == \"\" — e.g. a tools.yaml entry of kind cassandra-cql missing the description field or with an empty value after variable expansion.","commonSituations":"Authoring tools.yaml by hand and omitting description; ${VAR} placeholders resolving to empty; YAML mis-nesting so description lands in the wrong scope; minimal examples copied without the field.","solutions":["Add a non-empty description field to the cassandra-cql tool definition in tools.yaml","Check that env-var/template substitution for description yields a non-empty string","Fix YAML indentation so description is nested under the tool","Restart the server and confirm the tool initializes"],"exampleFix":"// before (tools.yaml)\ntools:\n  cql-query:\n    kind: cassandra-cql\n    source: my-cassandra\n    statement: SELECT * FROM keyspace.table\n// after\ntools:\n  cql-query:\n    kind: cassandra-cql\n    source: my-cassandra\n    description: Executes a CQL statement against the Cassandra cluster.\n    statement: SELECT * FROM keyspace.table","handlingStrategy":"validation","validationCode":"// Validate before building the tool\ncfg := cassandracql.Config{Name: \"cql-query\", Source: \"my-cassandra\"}\nif strings.TrimSpace(cfg.Description) == \"\" {\n    return fmt.Errorf(\"tool %q requires a non-empty description\", cfg.Name)\n}\n// Or check the YAML node: tools[\"cql-query\"].description must exist and be non-empty","typeGuard":"func hasDescription(name, desc string) bool {\n    return strings.TrimSpace(desc) != \"\"\n}","tryCatchPattern":null,"preventionTips":["Include description for every cassandra-cql tool in tools.yaml","Add a CI check that lints tools.yaml for required fields","Give env-backed descriptions sensible defaults (e.g. ${DESC:-fallback text})","Fix YAML indentation so description is a child of the tool mapping"],"tags":["go","config","validation","cassandra"],"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"}