{"record":{"id":"a30a22aba9e5bd6d","repo":"ruvnet/ruflo","slug":"parameter-name-must-be-a-string","errorCode":null,"errorMessage":"Parameter '${name}' must be a string","messagePattern":"Parameter '(.+?)' must be a string","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/plugins/teammate-plugin/src/mcp-tools.ts","lineNumber":36,"sourceCode":"  TeleportTarget,\n  MessageType,\n} from './types.js';\n\nimport { MCP_PARAM_LIMITS } from './types.js';\n\n// Use centralized security constants from types.ts\nconst { MAX_PARAM_LENGTH, MAX_ARRAY_ITEMS } = MCP_PARAM_LIMITS;\n\n// ============================================================================\n// Input Validation\n// ============================================================================\n\n/**\n * Validate string parameter\n */\nfunction validateStringParam(value: unknown, name: string, maxLength: number = MAX_PARAM_LENGTH): string {\n  if (typeof value !== 'string') {\n    throw new Error(`Parameter '${name}' must be a string`);\n  }\n  if (value.length > maxLength) {\n    throw new Error(`Parameter '${name}' exceeds maximum length of ${maxLength}`);\n  }\n  return value;\n}\n\n/**\n * Validate array parameter\n */\nfunction validateArrayParam<T>(value: unknown, name: string, maxItems: number = MAX_ARRAY_ITEMS): T[] {\n  if (!Array.isArray(value)) {\n    throw new Error(`Parameter '${name}' must be an array`);\n  }\n  if (value.length > maxItems) {\n    throw new Error(`Parameter '${name}' exceeds maximum of ${maxItems} items`);\n  }\n  return value as T[];","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/teammate-plugin/src/mcp-tools.ts#L18-L54","documentation":"MCP input-validation helper: validateStringParam() received a value whose typeof is not 'string' for the named parameter (e.g. name, role, prompt, teamName, fromId, toId). Tool arguments came from untrusted JSON-RPC input and failed the type check before any business logic ran.","triggerScenarios":"Thrown at v3/plugins/teammate-plugin/src/mcp-tools.ts:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a string value for this parameter; coerce or reject non-string input before validation."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}