github/github-mcp-server · error

missing required parameter

Error message

missing required parameter: %s

What it means

Thrown by RequiredParam in pkg/github/params.go when a required argument is entirely absent from the tool request. This is the first of three checks in the generic required-parameter extractor: presence, type, non-zero. Most string-typed required params (owner, repo, title, query, ...) go through it.

Solutions

  1. Add the missing argument with the exact key name from the tool's inputSchema.
  2. Check parameter casing/snake_case — the error text names the exact key the server looked for.
  3. If the call previously worked, diff the server version's tool schemas; a new required field may have been introduced.
  4. Validate arguments against inputSchema client-side before dispatch.

Example fix

// before
arguments = { owner, repo, body: "text" } // create_issue missing title
// after
arguments = { owner, repo, title: "Bug report", body: "text" }
Defensive patterns

Strategy: validation

Validate before calling

function requireArgs(args, schema) {
  for (const [name, prop] of Object.entries(schema.properties || {})) {
    if (schema.required?.includes(name) && (args[name] === undefined)) {
      throw new Error(`missing required parameter: ${name}`);
    }
  }
}

Type guard

function hasAllRequired(args: object, required: string[]): args is Record<string, unknown> {
  return required.every((k) => args[k] !== undefined);
}

Try / catch

On 'missing required parameter: X', read the exact key name from the message, add it with a valid value, and retry; the rest of the payload was accepted structurally.

Prevention

When it happens

Trigger: Calling create_issue without title; get_pull_request without pull_number; any tool call where the arguments object is missing a key marked required in the schema.

Common situations: LLM omitting fields it considers optional; client code with typos in key names (PullNumber vs pull_number); schema drift after server upgrade adding a new required param; empty arguments object sent by mistake.

Related errors


AI-assisted analysis of github/github-mcp-server@0ea1f775a7 (2026-08-15). Data as JSON: /api/errors/e642909e2411aaa8. Report an issue: GitHub.

Appendix: source

Thrown at pkg/github/params.go:133

	result := int64(f)
	// Check round-trip to detect precision loss for large int64 values
	if float64(result) != f {
		return 0, fmt.Errorf("numeric value %v is too large to fit in int64", f)
	}
	return result, nil
}

// RequiredParam is a helper function that can be used to fetch a requested parameter from the request.
// It does the following checks:
// 1. Checks if the parameter is present in the request.
// 2. Checks if the parameter is of the expected type.
// 3. Checks if the parameter is not empty, i.e: non-zero value
func RequiredParam[T comparable](args map[string]any, p string) (T, error) {
	var zero T

	// Check if the parameter is present in the request
	if _, ok := args[p]; !ok {
		return zero, fmt.Errorf("missing required parameter: %s", p)
	}

	// Check if the parameter is of the expected type
	val, ok := args[p].(T)
	if !ok {
		return zero, fmt.Errorf("parameter %s is not of type %T", p, zero)
	}

	if val == zero {
		return zero, fmt.Errorf("missing required parameter: %s", p)
	}

	return val, nil
}

// RequiredInt is a helper function that can be used to fetch a requested parameter from the request.
// It does the following checks:
// 1. Checks if the parameter is present in the request.

View on GitHub (pinned to 0ea1f775a7)