googleapis/mcp-toolbox · error
description is required for tool %q
Error message
description is required for tool %q
What it means
Config.Initialize for cloudloggingadmin-querylogs enforces a non-empty 'description' because it is required to build the MCP tool manifest. A missing or empty description aborts tool initialization with this error.
Source
Thrown at internal/tools/cloudloggingadmin/cloudloggingadminquerylogs/cloudloggingadminquerylogs.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)
}
startTimeDescription := fmt.Sprintf("Start time in RFC3339 format (e.g., 2025-12-09T00:00:00Z). Defaults to %d days ago.", defaultStartTimeOffsetDays)
limitDescription := fmt.Sprintf("Maximum number of log entries to return. Default: %d.", defaultLimit)
params := parameters.Parameters{
parameters.NewStringParameter(
"filter",
"Cloud Logging filter query. Common fields: resource.type, resource.labels.*, logName, severity, textPayload, jsonPayload.*, protoPayload.*, labels.*, httpRequest.*. Operators: =, !=, <, <=, >, >=, :, =~, AND, OR, NOT.", parameters.WithStringRequired(false)),
parameters.NewBooleanParameter("newestFirst", "Set to true for newest logs first. Defaults to oldest first.", parameters.WithBooleanRequired(false)),
parameters.NewStringParameter("startTime", startTimeDescription, parameters.WithStringRequired(false)),
parameters.NewStringParameter("endTime", "End time in RFC3339 format (e.g., 2025-12-09T23:59:59Z). Defaults to now.", parameters.WithStringRequired(false)),
parameters.NewBooleanParameter("verbose", "Include additional fields (insertId, trace, spanId, httpRequest, labels, operation, sourceLocation). Defaults to false.", parameters.WithBooleanRequired(false)),
parameters.NewIntParameter("limit", limitDescription, parameters.WithIntRequired(false)),
}
return Tool{
BaseTool: tools.NewBaseTool(
cfg,View on GitHub (pinned to 8cc6e09de2)
Solutions
- Add a meaningful non-empty `description:` to the querylogs tool entry.
- Check indentation so description actually lands inside the tool's mapping.
- Fix the tool named in the error message (cfg.Name) rather than scanning the whole file.
Example fix
// before
query-logs:
kind: cloud-logging-admin-query-logs
source: my-logging-source
// after
query-logs:
kind: cloud-logging-admin-query-logs
source: my-logging-source
description: Queries Cloud Logging entries with an optional filter, start time, and limit. Defensive patterns
Strategy: validation
Validate before calling
// Go: check required config fields before Initialize
if cfg.Name == "" || cfg.Description == "" {
return nil, fmt.Errorf("tool %q: name and description are required", cfg.Name)
} Try / catch
tool, err := cfg.Initialize(ctx)
if err != nil && strings.Contains(err.Error(), "description is required") {
return nil, fmt.Errorf("tools.yaml: add description for tool %q", cfg.Name)
} Prevention
- Treat description as a mandatory field in your tools.yaml template.
- Add a CI schema check (e.g. JSON schema / yamllint with required keys).
- If generating configs programmatically, assert description non-empty before writing YAML.
When it happens
Trigger: Loading a tools.yaml whose cloudloggingadmin-querylogs tool entry lacks `description` or sets it to "".
Common situations: Minimal/hand-written tool configs; YAML nesting errors putting description at the wrong level; generated configs from scripts that leave description blank.
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
- description is required for tool %q
- description is required for tool %q
- doc %d: unexpected non-string key in input: %v
- doc %d: invalid config format at key %q: %w
- doc %d: invalid config format at key %q: expected nested for
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/d8fb738029a26b26.
Report an issue: GitHub.