{"record":{"id":"7219cacd29dad757","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-7219ca","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/looker/lookerdeleteprojectfile/lookerdeleteprojectfile.go","lineNumber":72,"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\tprojectIdParameter := parameters.NewStringParameter(\"project_id\", \"The id of the project containing the files\")\n\tfilePathParameter := parameters.NewStringParameter(\"file_path\", \"The path of the file within the project\")\n\tparams := parameters.Parameters{projectIdParameter, filePathParameter}\n\n\t// finish tool setup\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\n// validate interface","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookerdeleteprojectfile/lookerdeleteprojectfile.go#L54-L90","documentation":"Looker tool configs require a non-empty description because it becomes the tool's description surfaced to LLM clients via MCP. Initialize fails fast when Config.Description is empty so that an undescribed tool is never registered.","triggerScenarios":"Loading a tools YAML where a lookerdeleteprojectfile tool entry omits the description field (or sets it to \"\"), then calling Config.Initialize.","commonSituations":"Hand-editing tool configs and dropping the description; programmatically constructing Config{} without setting Description; copy-pasting a minimal tool block without all required fields.","solutions":["Add a description field to the tool's YAML config","Set cfg.Description before calling Initialize in code","Run toolbox with --prebuilt to use validated prebuilt configs"],"exampleFix":"// before\n- name: delete-project-file\n  source: my-looker\n// after\n- name: delete-project-file\n  source: my-looker\n  description: Deletes a file within a Looker project","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(cfg.Description) == \"\" { return errors.New(\"looker tool config requires a description\") }","typeGuard":null,"tryCatchPattern":"if err := cfg.Initialize(ctx); err != nil { log.Fatalf(\"tool config invalid: %v\", err) }","preventionTips":["Include description in every tool YAML entry","Lint tool configs for required fields before deployment","Reuse prebuilt configs where possible"],"tags":["go","looker","config","missing-field"],"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"}