{"record":{"id":"98fc945d0e2b6371","repo":"FlowiseAI/Flowise","slug":"both-chat-id-and-user-id-are-required","errorCode":null,"errorMessage":"Both Chat ID and User ID are required","messagePattern":"Both Chat ID and User ID are required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/MicrosoftTeams/core.ts","lineNumber":837,"sourceCode":"            description: 'Add a member to a chat',\n            schema: z.object({\n                chatId: z.string().describe('ID of the chat'),\n                userId: z.string().describe('ID of the user to add')\n            }),\n            baseUrl: BASE_URL,\n            method: 'POST',\n            headers: {}\n        }\n\n        super({ ...toolInput, accessToken: args.accessToken, defaultParams: args.defaultParams })\n    }\n\n    protected async _call(arg: any): Promise<string> {\n        const params = { ...arg, ...this.defaultParams }\n        const { chatId, userId } = params\n\n        if (!chatId || !userId) {\n            throw new Error('Both Chat ID and User ID are required')\n        }\n\n        try {\n            const body = {\n                '@odata.type': '#microsoft.graph.aadUserConversationMember',\n                'user@odata.bind': `https://graph.microsoft.com/v1.0/users('${userId}')`\n            }\n\n            const endpoint = `/chats/${chatId}/members`\n            await this.makeTeamsRequest(endpoint, 'POST', body)\n\n            return this.formatResponse(\n                {\n                    success: true,\n                    message: 'Member added to chat successfully'\n                },\n                params\n            )","sourceCodeStart":819,"sourceCodeEnd":855,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/MicrosoftTeams/core.ts#L819-L855","documentation":"Thrown by the AddChatMember Teams tool's _call when either chatId or userId is falsy after merging the runtime argument with defaultParams. The tool adds an Azure AD user as a member of a Microsoft Teams chat via the Graph API endpoint POST /chats/{chatId}/members. Both identifiers are required because the Graph API needs them to construct the user@odata.bind reference and the membership endpoint.","triggerScenarios":"Calling the AddChatMember tool without passing chatId, without passing userId, or passing an empty string / null / undefined for either. Also triggers if defaultParams was expected to supply one but was not configured on the node.","commonSituations":"The LLM agent omits one of the two IDs when invoking the tool; the Flowise/agent node has chatId bound to an upstream variable that resolved to empty; the user wired the tool input schema incorrectly and left a required field blank.","solutions":["Ensure the tool invocation payload includes both a non-empty chatId and a non-empty userId (e.g. { chatId: '19:abc...', userId: 'user-guid' }).","If one ID is constant for the run, set it in the node's defaultParams so it merges in even when the agent omits it.","Verify the upstream node feeding chatId/userId actually produced a value before the tool executes.","Check that the agent's prompt or function schema describes both parameters as required."],"exampleFix":"// before\nawait tool._call({ chatId: '19:meeting...' })\n// after\nawait tool._call({ chatId: '19:meeting...', userId: 'a1b2c3d4-e5f6-...' })","handlingStrategy":"validation","validationCode":"function hasChatAndUser(params: any): boolean {\n  return Boolean(params && params.chatId && params.userId)\n}\n// before invoking:\nif (!hasChatAndUser(arg)) throw new Error('chatId and userId are required')","typeGuard":"function isAddMemberArgs(a: unknown): a is { chatId: string; userId: string } {\n  return typeof a === 'object' && a !== null\n    && typeof (a as any).chatId === 'string' && (a as any).chatId.length > 0\n    && typeof (a as any).userId === 'string' && (a as any).userId.length > 0\n}","tryCatchPattern":"try {\n  const out = await addMemberTool.call(arg)\n} catch (e) {\n  if (e instanceof Error && e.message === 'Both Chat ID and User ID are required') {\n    // surface missing-input feedback to the agent for self-correction\n  } else throw e\n}","preventionTips":["Define the tool's Zod schema with chatId and userId as required strings.","Pre-populate stable IDs via defaultParams.","Validate upstream variables are non-empty before the tool node runs."],"tags":["microsoft-teams","validation","graph-api","missing-argument"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}