googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

Tool registration requires a non-empty `description`, which the toolbox surfaces to LLM clients. `Initialize` for looker-get-connection-table-columns validates the description and fails tool creation when it is empty.

Source

Thrown at internal/tools/looker/lookergetconnectiontablecolumns/lookergetconnectiontablecolumns.go:71

}

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

// validate interface
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)
	}

	connParameter := parameters.NewStringParameter("conn", "The connection containing the tables.")
	dbParameter := parameters.NewStringParameter("db", "The optional database to search", parameters.WithStringRequired(false))
	schemaParameter := parameters.NewStringParameter("schema", "The schema containing the tables.")
	tablesParameter := parameters.NewStringParameter("tables", "A comma separated list of tables containing the columns.")
	params := parameters.Parameters{connParameter, dbParameter, schemaParameter, tablesParameter}

	// finish tool setup
	return Tool{
		BaseTool: tools.NewBaseTool(
			cfg,
			tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewReadOnlyAnnotations),
			tools.Manifest{Description: cfg.Description, Parameters: params.Manifest(), AuthRequired: cfg.AuthRequired},
			params,
		),
	}, nil
}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a non-empty `description:` to the tool entry in tools.yaml
  2. Set cfg.Description before calling Initialize in Go code
  3. Validate the config file at CI time to catch missing required fields early

Example fix

// before
tools:
  cols:
    kind: looker-get-connection-table-columns
    source: my-looker
// after
tools:
  cols:
    kind: looker-get-connection-table-columns
    source: my-looker
    description: Lists columns of tables in a Looker connection.
Defensive patterns

Strategy: validation

Validate before calling

if cfg.Description == "" {
    return fmt.Errorf("tool %q: description is mandatory", cfg.Name)
}

Try / catch

tool, err := cfg.Initialize(ctx)
if err != nil && strings.Contains(err.Error(), "description is required") {
    return fmt.Errorf("fix tools.yaml: %w", err)
}

Prevention

When it happens

Trigger: Config.Initialize is called for a looker-get-connection-table-columns tool whose `description` field is missing or "".

Common situations: Hand-written tools.yaml missing the description key; programmatic Config with zero-valued Description; config templates that drop optional-looking fields.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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