{"record":{"id":"91dbdcd73f83078d","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-91dbdc","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/http/http.go","lineNumber":81,"sourceCode":"\tHeaders          map[string]string      `yaml:\"headers\"`\n\tRequestBody      string                 `yaml:\"requestBody\"`\n\tPathParams       parameters.Parameters  `yaml:\"pathParams\"`\n\tQueryParams      parameters.Parameters  `yaml:\"queryParams\"`\n\tBodyParams       parameters.Parameters  `yaml:\"bodyParams\"`\n\tHeaderParams     parameters.Parameters  `yaml:\"headerParams\"`\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\t// Create a slice for all parameters\n\tallParameters := slices.Concat(cfg.PathParams, cfg.QueryParams, cfg.BodyParams, cfg.HeaderParams)\n\n\t// Verify no duplicate parameter names\n\terr := parameters.CheckDuplicateParameters(allParameters)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Create Toolbox manifest\n\tparamManifest := allParameters.Manifest()\n\n\tif paramManifest == nil {\n\t\tparamManifest = make([]parameters.ParameterManifest, 0)\n\t}\n","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/http/http.go#L63-L99","documentation":"The generic \"http\" tool requires a description because it is surfaced to LLM clients in the manifest. Config.Initialize fails with this error when an http tool in tools.yaml lacks a non-empty description field.","triggerScenarios":"An http tool entry omits \"description\" or has it as an empty string; Initialize() is invoked while loading the toolbox configuration and returns this error, aborting startup of that tool.","commonSituations":"Rapid prototyping of HTTP tools where description is left as a TODO; YAML mis-indentation placing description at the wrong level; config generators emitting empty strings for optional-looking fields.","solutions":["Add a meaningful non-empty \"description\" to the http tool entry in tools.yaml.","Check YAML indentation so \"description\" belongs to the tool mapping.","Add a config lint step that fails CI when any tool entry has an empty description."],"exampleFix":"# before\nfetch-users:\n  type: http\n  source: api-src\n  path: /users\n  method: GET\n# after\nfetch-users:\n  type: http\n  source: api-src\n  path: /users\n  method: GET\n  description: Fetch a list of users from the API","handlingStrategy":"validation","validationCode":"// Validate all http tool entries before serving\nfor _, tool := range httpTools {\n    if strings.TrimSpace(tool.Description) == \"\" {\n        return fmt.Errorf(\"http tool %q requires a non-empty description\", tool.Name)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat description as a required field in every http tool definition","Write descriptions that help the LLM choose the tool correctly","Add CI config validation so missing descriptions fail the build, not server startup"],"tags":["go","config","validation","http"],"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"}