{"record":{"id":"aef4a5805491eddf","repo":"eyaltoledano/claude-task-master","slug":"missing-parameter-aef4a5","errorCode":"MISSING_PARAMETER","errorMessage":"Old tag name is required and must be a string","messagePattern":"Old tag name is required and must be a string","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mcp-server/src/core/direct-functions/rename-tag.js","lineNumber":57,"sourceCode":"\t\t\tlog.error('renameTagDirect 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 (!oldName || typeof oldName !== 'string') {\n\t\t\tlog.error('Missing required parameter: oldName');\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: 'Old tag name is required and must be a string'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tif (!newName || typeof newName !== 'string') {\n\t\t\tlog.error('Missing required parameter: newName');\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: 'New 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(`Renaming tag from \"${oldName}\" to \"${newName}\"`);","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/rename-tag.js#L39-L75","documentation":"The tag being renamed (`oldName`) must be a non-empty string. renameTagDirect validates this after checking tasksJsonPath and returns MISSING_PARAMETER if oldName is missing, empty, or not a string.","triggerScenarios":"rename_tag called with oldName absent, oldName: '' , oldName: null, or a non-string (number/object) — e.g. an agent passing { name: 3 } or putting oldName under a different key.","commonSituations":"An LLM supplying the wrong argument name so oldName is undefined; numeric tag names passed as numbers instead of strings; empty tag name from a failed upstream lookup; client schema drift renaming the field.","solutions":["Provide oldName as a non-empty string matching an existing tag exactly (check task-master tags list)","Coerce numeric or otherwise non-string tag values to strings before calling","Fix the argument key name in the calling code so the value lands in oldName","Run task-master tags to confirm the source tag exists before renaming"],"exampleFix":"// before\nawait client.callTool('rename_tag', { oldName: 42, newName: 'sprint-2' });\n\n// after\nawait client.callTool('rename_tag', { oldName: '42', newName: 'sprint-2', projectRoot: '/project' });","handlingStrategy":"type-guard","validationCode":"if (typeof oldName !== 'string' || oldName.trim() === '') {\n  throw new Error('rename_tag: oldName must be a non-empty string');\n}","typeGuard":"function isNonEmptyString(v) {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":"try {\n  const res = await client.callTool('rename_tag', { oldName, newName, projectRoot });\n  if (res.error?.code === 'MISSING_PARAMETER' && /old tag/i.test(res.error.message)) {\n    console.error('oldName missing or wrong type — pass the existing tag name as a string');\n  }\n} catch (e) {\n  console.error('rename_tag failed:', e.message);\n}","preventionTips":["Coerce tag values from config/UI to strings before calling","List tags (task-master tags) and use the exact existing name","Validate both oldName and newName with a shared isNonEmptyString check"],"tags":["mcp","validation","parameter-type"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}