{"record":{"id":"45878ed31cb45b41","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-45878e","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/postgres/postgreslistactivequeries/postgreslistactivequeries.go","lineNumber":90,"sourceCode":"\tRunSQL(context.Context, string, []any) (any, error)\n}\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\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\tallParameters := parameters.Parameters{\n\t\tparameters.NewStringParameter(\"min_duration\", \"Optional: Only show queries running at least this long (e.g., '1 minute', '1 second', '2 seconds').\", parameters.WithStringDefault(\"1 minute\")),\n\t\tparameters.NewStringParameter(\"exclude_application_names\", \"Optional: A comma-separated list of application names to exclude from the query results. This is useful for filtering out queries from specific applications (e.g., 'psql', 'pgAdmin', 'DBeaver'). The match is case-sensitive. Whitespace around commas and names is automatically handled. If this parameter is omitted, no applications are excluded.\", parameters.WithStringDefault(\"\")),\n\t\tparameters.NewIntParameter(\"limit\", \"Optional: The maximum number of rows to return.\", parameters.WithIntDefault(50)),\n\t}\n\tparamManifest := allParameters.Manifest()\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","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/postgres/postgreslistactivequeries/postgreslistactivequeries.go#L72-L108","documentation":"Initialize rejects a tool configuration whose 'description' field is empty. Description is mandatory for this tool type (it feeds the LLM tool manifest), so the error fires during startup when the tools.yaml entry omits or leaves blank the 'description' key.","triggerScenarios":"Thrown at internal/tools/postgres/postgreslistactivequeries/postgreslistactivequeries.go:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a non-empty 'description' field to the tool entry in tools.yaml","Describe what the tool does so the LLM can select it appropriately"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}