wavetermdev/waveterm · error

missing values parameter

Error message

missing values parameter

What it means

The tool callback successfully coerced input to a map but the required key "values" is absent. The tool's JSON schema declares "values" as required, so a call omitting it violates the contract and this error is returned to the model so it can retry with correct arguments.

Solutions

  1. Include the required "values" key in the tool arguments: {"values": [1,2,3]}
  2. Improve the tool description/prompt so the model uses the exact parameter name "values"
  3. If the schema is rendered for the model, confirm the required:["values"] constraint is being advertised to the client

Example fix

// before
anySum({})
// after
anySum({"values": [1, 2, 3]})
Defensive patterns

Strategy: validation

Validate before calling

m, ok := raw.(map[string]any); if !ok { return errors.New("input not an object") }; if _, ok := m["values"]; !ok { return errors.New("values is required") }

Type guard

func hasValues(m map[string]any) bool { _, ok := m["values"]; return ok }

Try / catch

out, err := tool.Call(input); if err != nil && strings.Contains(err.Error(), "missing values") { retryWithCorrection(err.Error()) }

Prevention

When it happens

Trigger: LLM invokes the any-sum tool with an object that lacks the "values" key, e.g. {} or {"numbers": [1,2]} — schema-required parameter missing from the arguments map.

Common situations: Model hallucinating alternate parameter names (numbers, list, items); truncation of generated arguments; hand-written tool call payloads missing the key; prompt instructions that don't name the parameter explicitly.

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 wavetermdev/waveterm@a4447c1563 (2026-09-01). Data as JSON: /api/errors/2c33a44c6aa238be. Report an issue: GitHub.

Appendix: source

Thrown at pkg/aiusechat/tools.go:294

					"type": "array",
					"items": map[string]any{
						"type": "integer",
					},
					"description": "Array of numbers to add together",
				},
			},
			"required":             []string{"values"},
			"additionalProperties": false,
		},
		ToolAnyCallback: func(input any, toolUseData *uctypes.UIMessageDataToolUse) (any, error) {
			inputMap, ok := input.(map[string]any)
			if !ok {
				return nil, fmt.Errorf("invalid input format")
			}

			valuesInterface, ok := inputMap["values"]
			if !ok {
				return nil, fmt.Errorf("missing values parameter")
			}

			valuesSlice, ok := valuesInterface.([]any)
			if !ok {
				return nil, fmt.Errorf("values must be an array")
			}

			if len(valuesSlice) == 0 {
				return 0, nil
			}

			sum := 0
			for i, val := range valuesSlice {
				floatVal, ok := val.(float64)
				if !ok {
					return nil, fmt.Errorf("value at index %d is not a number", i)
				}
				sum += int(floatVal)

View on GitHub (pinned to a4447c1563)