{"record":{"id":"8503583ed7106587","repo":"github/github-mcp-server","slug":"parameter-s-could-not-be-coerced-to-int64-is","errorCode":null,"errorMessage":"parameter %s could not be coerced to []int64, is %T","messagePattern":"parameter (.+?) could not be coerced to \\[\\]int64, is %T","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/params.go","lineNumber":341,"sourceCode":"\t\treturn []int64{}, nil\n\tcase []string:\n\t\treturn convertStringSliceToBigIntSlice(v)\n\tcase []any:\n\t\tint64Slice := make([]int64, len(v))\n\t\tfor i, v := range v {\n\t\t\ts, ok := v.(string)\n\t\t\tif !ok {\n\t\t\t\treturn []int64{}, fmt.Errorf(\"parameter %s is not of type string, is %T\", p, v)\n\t\t\t}\n\t\t\tval, err := convertStringToBigInt(s, 0)\n\t\t\tif err != nil {\n\t\t\t\treturn []int64{}, fmt.Errorf(\"parameter %s: failed to convert element %d (%s) to int64: %w\", p, i, s, err)\n\t\t\t}\n\t\t\tint64Slice[i] = val\n\t\t}\n\t\treturn int64Slice, nil\n\tdefault:\n\t\treturn []int64{}, fmt.Errorf(\"parameter %s could not be coerced to []int64, is %T\", p, args[p])\n\t}\n}\n\n// WithPagination adds REST API pagination parameters to a tool.\n// https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api\nfunc WithPagination(schema *jsonschema.Schema) *jsonschema.Schema {\n\tschema.Properties[\"page\"] = &jsonschema.Schema{\n\t\tType:        \"number\",\n\t\tDescription: \"Page number for pagination (min 1)\",\n\t\tMinimum:     jsonschema.Ptr(1.0),\n\t}\n\n\tschema.Properties[\"perPage\"] = &jsonschema.Schema{\n\t\tType:        \"number\",\n\t\tDescription: \"Results per page for pagination (min 1, max 100)\",\n\t\tMinimum:     jsonschema.Ptr(1.0),\n\t\tMaximum:     jsonschema.Ptr(100.0),\n\t}","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/params.go#L323-L359","documentation":"Returned by OptionalBigIntArrayParam's default branch when the parameter value is not nil, []string, or []any — the top-level shape is wrong for an int64-array parameter. Mirrors error 266 but for the BigInt array variant: any scalar or object where an array of numeric strings is expected.","triggerScenarios":"Passing \"123\" instead of [\"123\"]; passing a JSON object keyed by index; passing an integer or boolean; sending a comma-joined string of IDs.","commonSituations":"Single-element convenience (users omit brackets); LLM collapsing arrays; clients serializing arrays via strings.Join before dispatch.","solutions":["Wrap values in a JSON array with quoted elements: [\"123\"]","Split pre-joined strings client-side: strings.Split(ids, \",\") then send as array","Check the tool schema declares array of string items and let the client schema-validate before send"],"exampleFix":"// before\n{\"repository_ids\":\"123,456\"}\n// after\n{\"repository_ids\":[\"123\",\"456\"]}","handlingStrategy":"validation","validationCode":"func ensureArrayShape(args map[string]any, p string) error {\n    switch args[p].(type) {\n    case nil, []string, []any:\n        return nil\n    }\n    return fmt.Errorf(\"%s must be a JSON array of numeric strings\", p)\n}","typeGuard":"func isCoercibleToBigIntArray(v any) bool {\n    switch v.(type) {\n    case nil, []string, []any:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Always use array syntax for ID lists, even with one ID","Split joined ID strings before building the request","Validate against the tool's array-typed schema client-side"],"tags":["go","mcp","arrays","shape-mismatch","parameter-validation"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}