googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

Config.Initialize for clickhouse-sql (the raw execute-SQL tool) enforces a non-empty `description`, which the toolbox sends to LLM clients as the tool's manifest description. Missing descriptions are rejected during config load, before any request is served.

Source

Thrown at internal/tools/clickhouse/clickhousesql/clickhousesql.go:68

type Config struct {
	tools.ConfigBase   `yaml:",inline"`
	Type               string                 `yaml:"type" validate:"required"`
	Source             string                 `yaml:"source" validate:"required"`
	Statement          string                 `yaml:"statement" validate:"required"`
	Parameters         parameters.Parameters  `yaml:"parameters"`
	TemplateParameters parameters.Parameters  `yaml:"templateParameters"`
	Annotations        *tools.ToolAnnotations `yaml:"annotations,omitempty"`
}

var _ tools.ToolConfig = Config{}

func (cfg Config) ToolConfigType() string {
	return sqlType
}

func (cfg Config) Initialize(context.Context) (tools.Tool, error) {
	if cfg.Description == "" {
		return nil, fmt.Errorf("description is required for tool %q", cfg.Name)
	}

	allParameters, paramManifest, err := parameters.ProcessParameters(cfg.TemplateParameters, cfg.Parameters)
	if err != nil {
		return nil, err
	}

	return Tool{
		BaseTool: tools.NewBaseTool(
			cfg,
			tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewDestructiveAnnotations),
			tools.Manifest{Description: cfg.Description, Parameters: paramManifest, AuthRequired: cfg.AuthRequired},
			allParameters,
		),
	}, nil
}

var _ tools.Tool = Tool{}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a non-empty `description` describing what SQL the tool runs and any constraints.
  2. Fix YAML key/indentation issues so Description parses.
  3. Set Description in the Config struct before Initialize in programmatic use.

Example fix

// before
tools:
  run_sql:
    source: ch
// after
tools:
  run_sql:
    source: ch
    description: Execute a read-only SQL query against ClickHouse.
Defensive patterns

Strategy: validation

Validate before calling

// Go
if strings.TrimSpace(cfg.Description) == "" {
    return errors.New("clickhouse-sql tool requires a description")
}
tool, err := cfg.Initialize(context.Background())

Prevention

When it happens

Trigger: A `clickhouse-sql` tool entry in YAML with no `description` key/empty value, or Go code (tests like TestFailInitialization) building a Config with an empty Description and calling Initialize.

Common situations: Omitting optional-looking fields in handwritten configs; template rendering that blanks the description; typos in the YAML key.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/d31dcb13b2b9ccad. Report an issue: GitHub.