{"record":{"id":"24819aace744ec53","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-24819a","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/firebird/firebirdexecutesql/firebirdexecutesql.go","lineNumber":66,"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\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\nvar _ tools.Tool = Tool{}\n\ntype Tool struct {","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firebird/firebirdexecutesql/firebirdexecutesql.go#L48-L84","documentation":"Firebird execute-sql tool configuration validation: Config.Initialize rejects the tool when the description field is empty. The description is mandatory because it is surfaced to LLM clients as the tool's manifest description. The error names the affected tool via cfg.Name.","triggerScenarios":"A tools YAML config declares a firebird-execute-sql tool without a 'description' field (or with description: ''), then Initialize is called during config loading.","commonSituations":"Copy-pasting a tool config and forgetting the description; empty-string description from templating/env substitution; hand-written minimal configs omitting required fields.","solutions":["Add a non-empty 'description' field to the tool's YAML config.","Ensure env substitution (e.g., ${VAR}) for description is not resolving to an empty string.","Re-run toolbox after fixing the config."],"exampleFix":"// before\ntools:\n  execute_sql:\n    kind: firebird-execute-sql\n    source: my-firebird\n// after\ntools:\n  execute_sql:\n    kind: firebird-execute-sql\n    source: my-firebird\n    description: Executes arbitrary SQL against Firebird.","handlingStrategy":"validation","validationCode":"# Pre-validate the tool config before loading\nimport yaml, sys\ncfg = yaml.safe_load(open('tools.yaml'))\nfor name, t in cfg.get('tools', {}).items():\n    if t.get('kind') == 'firebird-execute-sql' and not t.get('description'):\n        sys.exit(f\"tool '{name}' is missing a description\")","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), \"description is required\") {\n        log.Fatalf(\"config error: %v (add a 'description' field to the tool)\", err)\n    }\n    return err\n}","preventionTips":["Always include a description field when authoring tool configs.","Lint tool YAMLs for required fields (name, kind, source, description).","Avoid empty env substitutions for description.","Validate configs in CI with `toolbox --prebuilt` or a config dry-run."],"tags":["firebird","config","validation"],"backgroundTag":"tool-description-required","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"}