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-createviewfromtable tool requires a non-empty Description in the Config. The description is included in the tool's MCP manifest so LLM clients know when to use the tool; an empty one means the tool config is incomplete and initialization fails with this error.

Source

Thrown at internal/tools/looker/lookercreateviewfromtable/lookercreateviewfromtable.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 to create the view in.")
	connectionParameter := parameters.NewStringParameter("connection", "The database connection name.")

	tableDef := parameters.NewMapParameter("table", "Table definition.", "")
	tablesParameter := parameters.NewArrayParameter("tables", `The tables to generate views for.
		Each item must be a map with:
		- schema (string, required)
		- table_name (string, required)
		- primary_key (string, optional)
		- base_view (boolean, optional)
		- columns (array of objects, optional): Each object must have 'column_name' (string).`, tableDef)

	folderNameParameter := parameters.NewStringParameter("folder_name", "The folder to place the view files in (e.g., 'views').", parameters.WithStringDefault("views"))

	params := parameters.Parameters{projectIdParameter, connectionParameter, tablesParameter, folderNameParameter}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a non-empty description to the looker-createviewfromtable entry in the tools YAML
  2. Validate the final rendered config to confirm description is populated
  3. Set Description when constructing lookercreateviewfromtable.Config in Go code

Example fix

# before
vpnTools:
  create-view:
    kind: looker-create-view-from-table
    source: my-looker
# after
vpnTools:
  create-view:
    kind: looker-create-view-from-table
    source: my-looker
    description: Creates a Looker view from a database table
Defensive patterns

Strategy: validation

Validate before calling

if strings.TrimSpace(cfg.Description) == "" {
    return fmt.Errorf("looker-create-view-from-table requires a description")
}

Type guard

func descriptionPresent(cfg lookercreateviewfromtable.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") {
        // set cfg.Description and re-initialize
    }
    return err
}

Prevention

When it happens

Trigger: Loading config where a looker-createviewfromtable tool entry has no description field or an empty string, triggering Initialize at server startup/config load.

Common situations: Omitted description key in hand-edited YAML; a template variable that resolved to empty; copy-pasted tool blocks with the description stripped.

Related errors


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