{"record":{"id":"ee2bbc79a3c6159a","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-ee2bbc","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/sqlite/sqliteexecutesql/sqliteexecutesql.go","lineNumber":67,"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\tsqlParameter := parameters.NewStringParameter(\"sql\", \"The sql to execute.\")\n\tparams := parameters.Parameters{sqlParameter}\n\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\nvar _ tools.Tool = Tool{}\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/sqlite/sqliteexecutesql/sqliteexecutesql.go#L49-L85","documentation":"sqlite-execute-sql requires a human-readable `description` for the tool. Config.Initialize returns this error before building the tool when cfg.Description is empty. The description is surfaced to the LLM, so it is mandatory in the tool spec.","triggerScenarios":"A tools.yaml defines a tool of kind `sqlite-execute-sql` without a `description:` field, or with an empty string; description set via templating that resolves to empty.","commonSituations":"Hand-writing a minimal tool config and omitting description; YAML indentation error placing description under the wrong key so it never populates the field; generating configs programmatically and skipping optional-looking fields.","solutions":["Add a non-empty `description:` field to the sqlite-execute-sql tool definition.","Check YAML indentation: description must be a sibling of name/source under the tool.","If description comes from a template/parameter, verify it resolves to a non-empty string."],"exampleFix":"# before\ntools:\n  exec-sql:\n    kind: sqlite-execute-sql\n    source: my-sqlite\n# after\ntools:\n  exec-sql:\n    kind: sqlite-execute-sql\n    source: my-sqlite\n    description: \"Executes arbitrary SQL statements against the SQLite database.\"","handlingStrategy":"validation","validationCode":"# Fail fast before starting the server:\nyq '.tools[] | select(.kind == \"sqlite-execute-sql\") | select(.description == null or .description == \"\") | .name' tools.yaml | grep . && echo 'missing description' && exit 1","typeGuard":"func hasDescription(kind, name, desc string) error {\n    if desc == \"\" { return fmt.Errorf(\"tool %q: description is required\", name) }\n    return null\n}","tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n    log.Fatalf(\"tool config invalid: %v\", err)\n}","preventionTips":["Always include description when scaffolding tool entries.","Add a CI lint that rejects tool configs without non-empty description.","Check YAML indentation when fields appear to be ignored.","Keep descriptions informative — they guide LLM tool selection."],"tags":["go","config","validation","sqlite"],"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"}