{"record":{"id":"e642909e2411aaa8","repo":"github/github-mcp-server","slug":"missing-required-parameter-s","errorCode":null,"errorMessage":"missing required parameter: %s","messagePattern":"missing required parameter: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/params.go","lineNumber":133,"sourceCode":"\tresult := int64(f)\n\t// Check round-trip to detect precision loss for large int64 values\n\tif float64(result) != f {\n\t\treturn 0, fmt.Errorf(\"numeric value %v is too large to fit in int64\", f)\n\t}\n\treturn result, nil\n}\n\n// RequiredParam is a helper function that can be used to fetch a requested parameter from the request.\n// It does the following checks:\n// 1. Checks if the parameter is present in the request.\n// 2. Checks if the parameter is of the expected type.\n// 3. Checks if the parameter is not empty, i.e: non-zero value\nfunc RequiredParam[T comparable](args map[string]any, p string) (T, error) {\n\tvar zero T\n\n\t// Check if the parameter is present in the request\n\tif _, ok := args[p]; !ok {\n\t\treturn zero, fmt.Errorf(\"missing required parameter: %s\", p)\n\t}\n\n\t// Check if the parameter is of the expected type\n\tval, ok := args[p].(T)\n\tif !ok {\n\t\treturn zero, fmt.Errorf(\"parameter %s is not of type %T\", p, zero)\n\t}\n\n\tif val == zero {\n\t\treturn zero, fmt.Errorf(\"missing required parameter: %s\", p)\n\t}\n\n\treturn val, nil\n}\n\n// RequiredInt is a helper function that can be used to fetch a requested parameter from the request.\n// It does the following checks:\n// 1. Checks if the parameter is present in the request.","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/params.go#L115-L151","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add the missing argument with the exact key name from the tool's inputSchema.","Check parameter casing/snake_case — the error text names the exact key the server looked for.","If the call previously worked, diff the server version's tool schemas; a new required field may have been introduced.","Validate arguments against inputSchema client-side before dispatch."],"exampleFix":"// before\narguments = { owner, repo, body: \"text\" } // create_issue missing title\n// after\narguments = { owner, repo, title: \"Bug report\", body: \"text\" }","handlingStrategy":"validation","validationCode":"function requireArgs(args, schema) {\n  for (const [name, prop] of Object.entries(schema.properties || {})) {\n    if (schema.required?.includes(name) && (args[name] === undefined)) {\n      throw new Error(`missing required parameter: ${name}`);\n    }\n  }\n}","typeGuard":"function hasAllRequired(args: object, required: string[]): args is Record<string, unknown> {\n  return required.every((k) => args[k] !== undefined);\n}","tryCatchPattern":"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.","preventionTips":["Validate against the tool's inputSchema (from tools/list) before dispatch.","Build arguments from typed interfaces so missing keys fail at compile time in TS.","Watch for snake_case/camelCase mismatches between your code and the schema."],"tags":["validation","missing-parameter","argument-parsing","mcp-tool"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}