{"record":{"id":"affce005644516bf","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-affce0","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/bigquery/bigqueryconversationalanalytics/bigqueryconversationalanalytics.go","lineNumber":129,"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\tparams := buildParams(nil)\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: 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\ntype Tool struct {\n\ttools.BaseTool[Config]","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/bigquery/bigqueryconversationalanalytics/bigqueryconversationalanalytics.go#L111-L147","documentation":"Config.Initialize for the bigquery-conversational-analytics tool validates that a description was provided before constructing the tool. An empty description is rejected because the tool's manifest (exposed to LLM clients) requires a human-readable description of what the tool does.","triggerScenarios":"Defining a bigqueryconversationalanalytics tool in a YAML config with no description field (or description: \"\"), causing Config.Initialize to return this error at server startup.","commonSituations":"Hand-edited toolbox YAML omitting the description; templated configs that drop optional-looking fields; copy-paste of a tool block that loses the description line.","solutions":["Add a non-empty description field to the tool's YAML config","If generating configs, ensure the description is always rendered","Run config validation before deploying to catch empty descriptions early"],"exampleFix":"// before\ntools:\n  my-tool:\n    kind: bigquery-conversational-analytics\n    source: my-bq-source\n// after\ntools:\n  my-tool:\n    kind: bigquery-conversational-analytics\n    source: my-bq-source\n    description: \"Ask natural-language questions against BigQuery datasets\"","handlingStrategy":"validation","validationCode":"func validateToolConfig(cfg map[string]any) error {\n    desc, ok := cfg[\"description\"].(string)\n    if !ok || desc == \"\" {\n        return fmt.Errorf(\"description is required for tool %v\", cfg[\"name\"])\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), \"description is required\") {\n        return fmt.Errorf(\"config error: add a 'description' field to tool %q\", cfg.Name)\n    }\n    return err\n}","preventionTips":["Always include a description for every tool in YAML configs","Add a config linter that fails on empty required fields","Use config templates that include description placeholders"],"tags":["bigquery","configuration","tool-config","validation"],"backgroundTag":"missing-required-config-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"}