googleapis/mcp-toolbox · error

error getting parameters for tool: %w

Error message

error getting parameters for tool: %w

What it means

Thrown by runInvoke (cmd/internal/invoke/command.go:119) when tool.GetParameters(src) returns an error while resolving the tool's parameter schema (its MCP inputSchema definitions) for the bound source. It means the tool definition itself is broken — e.g. its underlying parameter manifest cannot be built — not that the user-supplied params are wrong. The CLI aborts before parsing user params.

Source

Thrown at cmd/internal/invoke/command.go:119

	}

	var paramsInput string
	if len(args) > 1 {
		paramsInput = args[1]
	}

	params := make(map[string]any)
	if paramsInput != "" {
		if err := util.DecodeJSON(strings.NewReader(paramsInput), &params); err != nil {
			errMsg := fmt.Errorf("params must be a valid JSON string: %w", err)
			opts.Logger.ErrorContext(ctx, errMsg.Error())
			return errMsg
		}
	}

	toolParams, err := tool.GetParameters(src)
	if err != nil {
		errMsg := fmt.Errorf("error getting parameters for tool: %w", err)
		opts.Logger.ErrorContext(ctx, errMsg.Error())
		return errMsg
	}

	parsedParams, err := parameters.ParseParams(toolParams, params, nil)
	if err != nil {
		errMsg := fmt.Errorf("invalid parameters: %w", err)
		opts.Logger.ErrorContext(ctx, errMsg.Error())
		return errMsg
	}

	parsedParams, err = tool.EmbedParams(ctx, parsedParams, primitiveMgr)
	if err != nil {
		errMsg := fmt.Errorf("error embedding parameters: %w", err)
		opts.Logger.ErrorContext(ctx, errMsg.Error())
		return errMsg
	}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Run `toolbox serve` or `toolbox --tools-file` validation to see the underlying parameter schema error in the config.
  2. Inspect the wrapped error message for the offending parameter name in your tools YAML and fix its fields (name, type, description, required).
  3. Compare your tool definition against the canonical pattern (e.g. internal/tools/postgres/postgressql) or the prebuilt config for that source.
  4. Update the tools file to the schema expected by your installed toolbox version (check release notes for breaking changes).

Example fix

# before (tools.yaml)
tools:
  my-tool:
    kind: postgres-sql
    parameters:
      - type: string
# after (name is required)
tools:
  my-tool:
    kind: postgres-sql
    parameters:
      - name: query
        type: string
        description: SQL to execute
Defensive patterns

Strategy: validation

Validate before calling

// Start the server once to surface config/schema errors before invoking:
// toolbox serve --tools-file tools.yaml --prebuilt postgres
// Any bad parameter definition fails at startup with a precise message.

Try / catch

if err := runInvoke(...); err != nil {
  if strings.Contains(err.Error(), "error getting parameters for tool") {
    log.Fatalf("tool config invalid: %v", err)
  }
}

Prevention

When it happens

Trigger: Calling `toolbox invoke <tool> ...` for a tool whose GetParameters fails: a tool config with malformed/missing `parameters` YAML entries, a template/lookup in a parameter that references a missing resource, or a source-dependent schema resolution failure.

Common situations: Hand-edited tools.yaml with a bad parameter definition (wrong type, missing name/description fields), a prebuilt config mismatched with the configured source kind, or upgrading toolbox while keeping an old tools.yaml with fields that no longer parse.

Related errors


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