{"record":{"id":"3e363abc37ede27d","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-3e363a","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/bigtable/bigtablesql/bigtablesql.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.NewReadOnlyAnnotations),\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/bigtable/bigtablesql/bigtablesql.go#L52-L88","documentation":"This error is thrown by the bigtablesql tool's Config.Initialize when the tool YAML/config has no description set. MCP Toolbox requires every tool to have a non-empty description because it is exposed to the LLM in the tool manifest. The tool fails to initialize and is not registered.","triggerScenarios":"Calling Initialize on a bigtablesql Config whose Description field is the empty string — typically a tools.yaml entry of kind bigtable-sql that omits the description field or sets it to \"\".","commonSituations":"Hand-writing a tools.yaml and forgetting the description field; a templating/CI step stripping empty fields; copying a minimal example that omits description; YAML indentation errors that cause description to be parsed into a different key.","solutions":["Add a non-empty description field to the bigtablesql tool definition in tools.yaml","Verify the description is not empty after env-var/template expansion (e.g. ${TOOL_DESCRIPTION} resolving to \"\")","Check YAML indentation so the description key is nested under the correct tool","Run the server and inspect startup logs to confirm the tool now initializes"],"exampleFix":"// before (tools.yaml)\ntools:\n  execute-sql:\n    kind: bigtable-sql\n    source: my-bigtable-instance\n// after\ntools:\n  execute-sql:\n    kind: bigtable-sql\n    source: my-bigtable-instance\n    description: Executes SQL statements against BigQuery (Bigtable SQL layer).","handlingStrategy":"validation","validationCode":"// Before loading the config / starting the server\ncfg := bigtablesql.Config{Name: \"execute-sql\", Source: \"my-bigtable-instance\"}\nif cfg.Description == \"\" {\n    return fmt.Errorf(\"tool %q: description must be a non-empty string\", cfg.Name)\n}\n// Or validate the parsed YAML:\n// go-yaml: assert tools[\"execute-sql\"].description exists and is non-empty","typeGuard":"func hasDescription(name, desc string) bool {\n    return strings.TrimSpace(desc) != \"\"\n}","tryCatchPattern":null,"preventionTips":["Always include a description field for every tool in tools.yaml","Add a CI lint step that parses tools.yaml and asserts description is non-empty for all tools","Avoid empty-valued environment placeholders like DESCRIPTION=${TOOL_DESC} without a default","Validate the toolbox config with the toolbox CLI before deploying"],"tags":["go","config","validation","mcp","bigtable"],"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"}