{"record":{"id":"ecb3df2eba34d6e4","repo":"eyaltoledano/claude-task-master","slug":"missing-parameter-ecb3df","errorCode":"MISSING_PARAMETER","errorMessage":"Tag name is required and must be a string","messagePattern":"Tag name is required and must be a string","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/delete-tag.js","lineNumber":57,"sourceCode":"\t\t\tlog.error('deleteTagDirect 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(`Deleting tag: ${name}`);\n\n\t\t// Prepare options\n\t\tconst options = {\n\t\t\tyes // For MCP, we always skip confirmation prompts\n\t\t};\n\n\t\t// Call the deleteTag function\n\t\tconst result = await deleteTag(\n\t\t\ttasksJsonPath,\n\t\t\tname,\n\t\t\toptions,\n\t\t\t{","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/delete-tag.js#L39-L75","documentation":"deleteTagDirect validates that the tag 'name' parameter is present and is a non-empty string before attempting deletion. Anything falsy (undefined, null, empty string) or of the wrong type produces this MISSING_PARAMETER structured error.","triggerScenarios":"Calling delete_tag with name omitted, name: null, name: '' or a non-string (number, object) value; MCP schema validation bypassed by direct invocation of the direct function in tests or scripts.","commonSituations":"Tool calls built dynamically where the tag name variable is undefined; users typing a tag name with only whitespace trimming to empty; clients sending numeric IDs instead of tag name strings.","solutions":["Pass a non-empty string tag name: { name: 'my-tag' }.","List existing tags first (list_tags tool or read tasks.json tags) to confirm the exact name.","Trim and type-check the value client-side before sending.","If a numeric-looking name is involved, stringify it before calling."],"exampleFix":"// before\nawait deleteTagDirect({ tasksJsonPath, name: tagNameId }); // undefined\n// after\nif (typeof tagName !== 'string' || !tagName.trim()) throw new Error('tag name required');\nawait deleteTagDirect({ tasksJsonPath, name: tagName.trim() });","handlingStrategy":"type-guard","validationCode":"function assertTagName(name) {\n  if (typeof name !== 'string' || name.trim() === '') {\n    throw new TypeError('name must be a non-empty string');\n  }\n  return name.trim();\n}","typeGuard":"function isNonEmptyString(v) {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":"const res = await deleteTagDirect({ tasksJsonPath, name });\nif (!res.success && res.error?.code === 'MISSING_PARAMETER') {\n  // prompt user to pick a tag; list tags via list_tags before deleting\n}","preventionTips":["Trim and type-check tag names at the tool-call boundary.","List existing tags first and pass names from that list, never free-typed values.","Avoid dynamic argument building that can leave name undefined.","Enforce MCP tool schema (required string) so invalid calls are rejected before the function."],"tags":["mcp-server","validation","missing-parameter","tags"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}