googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

The postgres-sql tool's Initialize returns this error when the tool's `description` field is empty in tools.yaml. Every tool requires a human-readable description because it is surfaced to the LLM as the tool's manifest description, letting the model decide when to invoke the tool.

Source

Thrown at internal/tools/postgres/postgressql/postgressql.go:70

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 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)
	}
	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:` field to the postgres-sql tool entry in tools.yaml
  2. Check YAML indentation so `description` is a sibling of `kind`, `source`, and `statement`
  3. Validate the config with the toolbox binary before deploying

Example fix

# before
my-tool:
  kind: postgres-sql
  source: postgres-prod
  statement: SELECT 1
# after
my-tool:
  kind: postgres-sql
  source: postgres-prod
  description: Runs a SQL statement against Postgres and returns the rows.
  statement: SELECT 1
Defensive patterns

Strategy: validation

Validate before calling

// pre-validate the tool entry before handing it to the toolbox
cfg, _ := yaml.Marshal(toolEntry)
var check struct {
	Description string `yaml:"description"`
}
if err := yaml.Unmarshal(cfg, &check); err != nil || check.Description == "" {
	return fmt.Errorf("tool %q: description is required and must be non-empty", toolName)
}

Try / catch

if err := server.Start(ctx); err != nil {
	var cfgErr *config.ConfigError
	if errors.As(err, &cfgErr) && strings.Contains(err.Error(), "description is required") {
		log.Fatalf("config error: add a description to tool %q: %v", cfgErr.Tool, err)
	}
	return err
}

Prevention

When it happens

Trigger: Calling Initialize during server startup for a `kind: postgres-sql` tool whose YAML entry omits the `description:` field or sets it to an empty string.

Common situations: Writing a new tool entry by hand and forgetting the description; a templating/scripted config generator emitting empty descriptions; YAML indentation mistakes that place `description` under the wrong key so it never binds.

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/02dd30fd7b7fd010. Report an issue: GitHub.