googleapis/mcp-toolbox · error

unable to process parameters: %w

Error message

unable to process parameters: %w

What it means

trino-sql's Initialize calls parameters.ProcessParameters on its templateParameters and parameters; if processing fails (invalid parameter definitions, duplicate names, bad types), the error is wrapped with this message. It means the tool's parameter configuration could not be converted into runtime parameter objects.

Source

Thrown at internal/tools/trino/trinosql/trinosql.go:75

	TemplateParameters parameters.Parameters  `yaml:"templateParameters"`
	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)
	}

	allParameters, paramManifest, err := parameters.ProcessParameters(cfg.TemplateParameters, cfg.Parameters)
	if err != nil {
		return nil, fmt.Errorf("unable to process parameters: %w", err)
	}

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

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

type Tool struct {
	tools.BaseTool[Config]
}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Read the wrapped cause below this message for the specific parameter problem
  2. Fix the invalid parameter entry (name, type, description) in the tool config
  3. Remove or rename duplicate parameter names
  4. Ensure every parameter type is one supported by parameters.ProcessParameters

Example fix

// before (tools.yaml)
trino_query:
  kind: trino-sql
  parameters:
    - name: limit
      type: integerr
// after
trino_query:
  kind: trino-sql
  parameters:
    - name: limit
      type: integer
      description: Max rows to return.
Defensive patterns

Strategy: validation

Validate before calling

allowed := map[string]bool{"string": true, "integer": true, "boolean": true, "float": true, "array": true}
for _, p := range cfg["parameters"].([]map[string]any) {
    if !allowed[p["type"].(string)] {
        return fmt.Errorf("parameter %q has unsupported type %q", p["name"], p["type"])
    }
}

Try / catch

tool, err := cfg.Initialize(ctx)
if err != nil {
    if strings.Contains(err.Error(), "unable to process parameters") {
        return fmt.Errorf("fix parameter definitions: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: Initializing a trino-sql tool whose `templateParameters` or `parameters` lists contain invalid entries — e.g. missing name/type, unsupported type, duplicate parameter names, or otherwise malformed parameter specs.

Common situations: Misspelled parameter type names; duplicate parameter keys in the YAML; a template parameter referenced in `statement` but defined incorrectly; copy-pasted parameter blocks with clashing names.

Related errors


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