googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

The trino-execute-sql tool requires a non-empty `description` in its config; Config.Initialize returns this error when cfg.Description is empty. The description is exposed in the tool manifest so LLM clients know what the tool does.

Source

Thrown at internal/tools/trino/trinoexecutesql/trinoexecutesql.go:67

}

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

	sqlParameter := parameters.NewStringParameter("sql", "The SQL query to execute against the Trino database.")
	params := parameters.Parameters{sqlParameter}

	return Tool{
		BaseTool: tools.NewBaseTool(
			cfg,
			tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewDestructiveAnnotations),
			tools.Manifest{Description: cfg.Description, Parameters: params.Manifest(), AuthRequired: cfg.AuthRequired},
			params,
		),
	}, nil
}

// validate interface
var _ tools.Tool = Tool{}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a `description` field to the trino-execute-sql tool config with a non-empty string describing what the tool does
  2. Check YAML indentation so `description` is a direct child of the tool entry
  3. Ensure the value is not an empty string

Example fix

// before (tools.yaml)
execute_sql:
  kind: trino-execute-sql
  source: my-trino
// after
execute_sql:
  kind: trino-execute-sql
  source: my-trino
  description: Executes a SQL query against the Trino database and returns results.
Defensive patterns

Strategy: validation

Validate before calling

if cfg["description"] == "" || cfg["description"] == nil {
    return errors.New("trino-execute-sql tool: description is required")
}

Try / catch

tool, err := cfg.Initialize(ctx)
if err != nil {
    if strings.Contains(err.Error(), "description is required") {
        return fmt.Errorf("add description for tool %q", cfg.Name)
    }
    return err
}

Prevention

When it happens

Trigger: Defining a trino-execute-sql tool in the YAML (or constructing its Config programmatically) without a `description` field, or with an empty string, then decoding/initializing it.

Common situations: Omitting the description in tools.yaml; leaving it blank (`description: ""`); YAML indentation putting description under the wrong key; generating configs from templates that skip optional-looking fields.

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