{"record":{"id":"394708356bf62088","repo":"eyaltoledano/claude-task-master","slug":"missing-parameter-394708","errorCode":"MISSING_PARAMETER","errorMessage":"Tag name is required and must be a string","messagePattern":"Tag name is required and must be a string","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/use-tag.js","lineNumber":56,"sourceCode":"\t\t\tlog.error('useTagDirect called without tasksJsonPath');\n\t\t\tdisableSilentMode();\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'MISSING_ARGUMENT',\n\t\t\t\t\tmessage: 'tasksJsonPath is required'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t// Check required parameters\n\t\tif (!name || typeof name !== 'string') {\n\t\t\tlog.error('Missing required parameter: name');\n\t\t\tdisableSilentMode();\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'MISSING_PARAMETER',\n\t\t\t\t\tmessage: 'Tag name is required and must be a string'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tlog.info(`Switching to tag: ${name}`);\n\n\t\t// Call the useTag function\n\t\tconst result = await useTag(\n\t\t\ttasksJsonPath,\n\t\t\tname,\n\t\t\t{}, // options (empty for now)\n\t\t\t{\n\t\t\t\tsession,\n\t\t\t\tmcpLog,\n\t\t\t\tprojectRoot\n\t\t\t},\n\t\t\t'json' // outputFormat - use 'json' to suppress CLI UI","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/use-tag.js#L38-L74","documentation":"After checking tasksJsonPath, useTagDirect validates the required name parameter: it must be a non-empty string identifying the tag to switch to. Anything missing, null, or non-string is rejected with MISSING_PARAMETER.","triggerScenarios":"Calling use-tag without name, with name: null/undefined, or with a non-string value (number, object) — e.g. args parsed from JSON where the tag was intended to be quoted.","commonSituations":"Client sends {\"name\": 123} or omits name; CLI flag like --tag passed with no value; template expansion leaving name empty.","solutions":["Provide name as a non-empty string in the tool arguments","Quote string values in shell/JSON so they aren't parsed as numbers","Add client-side schema validation (e.g. zod: z.string().min(1)) before the call"],"exampleFix":"// before\nawait useTagDirect({ tasksJsonPath, name: 42 });\n// after\nawait useTagDirect({ tasksJsonPath, name: String(tagName) });","handlingStrategy":"validation","validationCode":"function assertTagName(args) {\n  if (!args || typeof args.name !== 'string' || args.name.length === 0) {\n    throw new Error('name is required and must be a non-empty string');\n  }\n}","typeGuard":"function hasTagName(a): a is { name: string } & Record<string, unknown> {\n  return typeof a === 'object' && a !== null && typeof (a as any).name === 'string' && (a as any).name.length > 0;\n}","tryCatchPattern":"try {\n  const res = await useTagDirect({ tasksJsonPath, name });\n  if (!res.success && res.error?.code === 'MISSING_PARAMETER') {\n    throw new TypeError(`use-tag: ${res.error.message}`);\n  }\n} catch (e) { /* handle */ }","preventionTips":["Validate name is a non-empty string before the call","Quote shell/JSON values so tags aren't coerced to numbers","Use zod/yup schemas at the CLI boundary: z.string().min(1)"],"tags":["mcp","missing-parameter","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}