{"record":{"id":"ed90af8246be7203","repo":"eyaltoledano/claude-task-master","slug":"missing-parameter","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/add-tag.js","lineNumber":142,"sourceCode":"\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tdata: {\n\t\t\t\t\tbranchName: result.branchName,\n\t\t\t\t\ttagName: result.tagName,\n\t\t\t\t\tcreated: result.created,\n\t\t\t\t\tmappingUpdated: result.mappingUpdated,\n\t\t\t\t\tmessage: `Successfully created tag \"${result.tagName}\" from git branch \"${result.branchName}\"`\n\t\t\t\t}\n\t\t\t};\n\t\t} else {\n\t\t\t// Check required parameters for regular tag creation\n\t\t\tif (!name || typeof name !== 'string') {\n\t\t\t\tlog.error('Missing required parameter: name');\n\t\t\t\tdisableSilentMode();\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: {\n\t\t\t\t\t\tcode: 'MISSING_PARAMETER',\n\t\t\t\t\t\tmessage: 'Tag name is required and must be a string'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tlog.info(`Creating new tag: ${name}`);\n\n\t\t\t// Prepare options\n\t\t\tconst options = {\n\t\t\t\tcopyFromCurrent,\n\t\t\t\tcopyFromTag,\n\t\t\t\tdescription\n\t\t\t};\n\n\t\t\t// Call the createTag function\n\t\t\tconst result = await createTag(\n\t\t\t\ttasksJsonPath,\n\t\t\t\tname,","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/add-tag.js#L124-L160","documentation":"addTagDirect validates that the tag name argument exists and is a string before creating the tag. Non-string values (numbers, null, undefined) or an absent name return this MISSING_PARAMETER error; the tag name is the primary key for tags so it must be well-formed.","triggerScenarios":"Calling add_tag without name, or with name as a non-string (e.g. 123, null, an object) — typically from MCP clients that don't enforce the schema.","commonSituations":"Older MCP client sending numeric tag names; prompt templating that leaves the name placeholder empty; programmatic tool calls bypassing schema validation.","solutions":["Provide name as a non-empty string in the add_tag call","Coerce/validate the tag name to a string before invoking the tool","Ensure the MCP client enforces the tool's input schema (name: string, required)"],"exampleFix":"// before\nadd_tag({ tasksJsonPath: path, name: 123 });\n// after\nadd_tag({ tasksJsonPath: path, name: String(tagName).trim() });","handlingStrategy":"validation","validationCode":"if (typeof args?.name !== 'string' || args.name.trim() === '') {\n  throw new TypeError('add_tag requires a non-empty string \"name\"');\n}","typeGuard":"function hasValidTagName(a) {\n  return typeof a?.name === 'string' && a.name.trim().length > 0;\n}","tryCatchPattern":"const res = await addTagDirect(args);\nif (!res.success && res.error?.code === 'MISSING_PARAMETER') {\n  // surface schema error to caller / fix the name argument\n}","preventionTips":["Coerce tag names to trimmed strings before calling","Enable strict input-schema validation in the MCP client","Ban numeric/undefined tag names in wrapper code"],"tags":["mcp","argument-validation","types"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}