googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

Tool configs must carry a non-empty `description`; it is exposed to LLM clients in the MCP manifest. `Initialize` for looker-get-connection-schemas validates this and aborts tool creation when it is empty.

Source

Thrown at internal/tools/looker/lookergetconnectionschemas/lookergetconnectionschemas.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 schemas.")
	dbParameter := parameters.NewStringParameter("db", "The optional database to search", parameters.WithStringRequired(false))
	params := parameters.Parameters{connParameter, dbParameter}

	// 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
}

// validate interface

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add `description:` with meaningful text to the tool entry in tools.yaml
  2. Set Description before invoking Initialize when building Config programmatically
  3. Lint the tools file so missing required fields are caught before deployment

Example fix

// before
tools:
  schemas:
    kind: looker-get-connection-schemas
    source: my-looker
// after
tools:
  schemas:
    kind: looker-get-connection-schemas
    source: my-looker
    description: Lists schemas available in a Looker connection.
Defensive patterns

Strategy: validation

Validate before calling

if strings.TrimSpace(cfg.Description) == "" {
    return fmt.Errorf("tool %q requires a description", cfg.Name)
}

Try / catch

tool, err := cfg.Initialize(ctx)
if err != nil {
    if strings.Contains(err.Error(), "description is required") {
        cfg.Description = "Lists Looker connection schemas."
        tool, err = cfg.Initialize(ctx)
    }
    if err != nil { return err }
}

Prevention

When it happens

Trigger: Config.Initialize is called for a looker-get-connection-schemas tool whose `description` is missing/empty in the tools file or in the constructed Config struct.

Common situations: YAML entry omitted the description key; empty-string description from templated config generation; prebuilt config edited locally and description accidentally removed.

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