googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

Config.Initialize for the elasticsearch-execute-esql tool validates that the tool's `description` field is non-empty before constructing the tool. Descriptions are required because they are exposed to LLM clients as the tool's Manifest description; without one the tool is useless to the model. Initialize returns this error and the tool fails to load.

Source

Thrown at internal/tools/elasticsearch/elasticsearchexecuteesql/elasticsearchexecuteesql.go:67

}

type Config struct {
	tools.ConfigBase `yaml:",inline"`
	Type             string                 `yaml:"type" validate:"required"`
	Source           string                 `yaml:"source" validate:"required"`
	Format           string                 `yaml:"format"`
	Annotations      *tools.ToolAnnotations `yaml:"annotations,omitempty"`
}

var _ tools.ToolConfig = Config{}

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

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

	queryParameter := parameters.NewStringParameter("query", "The ES|QL statement to execute.")
	params := parameters.Parameters{queryParameter}

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

var _ tools.Tool = Tool{}

type Tool struct {

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a non-empty `description` field to the tool entry in tools.yaml
  2. Check YAML indentation so `description` sits at the same level as `name`/`kind` under the tool
  3. Verify no stray quotes make the value parse as empty (e.g. description: "")
  4. Reload the toolbox config and confirm the tool appears in the tool list

Example fix

// before (tools.yaml)
tools:
  execute-esql:
    kind: elasticsearch-execute-esql
    source: es
// after
tools:
  execute-esql:
    kind: elasticsearch-execute-esql
    source: es
    description: Runs an ES|QL query against Elasticsearch and returns the results.
Defensive patterns

Strategy: validation

Validate before calling

// Validate tools.yaml entries before loading:
for name, t := range cfg.Tools {
    if t.Description == "" {
        return fmt.Errorf("tool %q is missing a description", name)
    }
}

Type guard

func hasDescription(t ToolConfigEntry) bool { return strings.TrimSpace(t.Description) != "" }

Try / catch

_, err := cfg.Initialize(context.Background())
if err != nil && strings.Contains(err.Error(), "description is required") {
    return fmt.Errorf("tools.yaml: add a description to the failing tool: %w", err)
}

Prevention

When it happens

Trigger: Loading a tools.yaml (or calling Initialize programmatically) where a tool with kind `elasticsearch-execute-esql` omits the `description` field or sets it to an empty string "".

Common situations: Hand-writing minimal tools.yaml entries and forgetting description; YAML indentation mistakes that leave description nested under the wrong key; template generators that skip optional-looking fields; trimming descriptions during config cleanup.

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/6d7c091fa04c1a9d. Report an issue: GitHub.