googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

Initialize for the looker-create-projectfile tool validates that the Config has a non-empty Description before constructing the tool. The description is required because it is surfaced to LLM clients through the MCP manifest. An empty description means the tool definition is incomplete, so initialization aborts with this error.

Source

Thrown at internal/tools/looker/lookercreateprojectfile/lookercreateprojectfile.go:72

}

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

	projectIdParameter := parameters.NewStringParameter("project_id", "The id of the project containing the files")
	filePathParameter := parameters.NewStringParameter("file_path", "The path of the file within the project")
	fileContentParameter := parameters.NewStringParameter("file_content", "The content of the file")
	params := parameters.Parameters{projectIdParameter, filePathParameter, fileContentParameter}

	// finish tool setup
	return Tool{
		BaseTool: tools.NewBaseTool(
			cfg,
			tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewWriteAnnotations),
			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 field to the looker-create-projectfile tool entry in the YAML config
  2. Validate the rendered config (e.g. print or lint it) to ensure the description value is not empty
  3. Update code that constructs lookercreateprojectfile.Config programmatically to set Description

Example fix

# before
vpnTools:
  create-file:
    kind: looker-create-projectfile
    source: my-looker
# after
vpnTools:
  create-file:
    kind: looker-create-projectfile
    source: my-looker
    description: Creates a new file within a Looker project
Defensive patterns

Strategy: validation

Validate before calling

if cfg.Name != "" && cfg.Description == "" {
    return fmt.Errorf("tool %q is missing required description", cfg.Name)
}

Type guard

func hasDescription(cfg lookercreateprojectfile.Config) bool {
    return strings.TrimSpace(cfg.Description) != ""
}

Try / catch

tool, err := cfg.Initialize(ctx)
if err != nil {
    if strings.Contains(err.Error(), "description is required") {
        // supply cfg.Description and retry
    }
    return err
}

Prevention

When it happens

Trigger: Loading a tools YAML where a looker-create-projectfile entry omits the description field or sets it to "" and then calling Initialize (during server startup or config load).

Common situations: Hand-written YAML missing the description key; description lost after copying a tool block; templated configs where a variable resolved to an empty string.

Related errors


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