{"record":{"id":"8bc935a4f1da88bd","repo":"FlowiseAI/Flowise","slug":"chat-id-is-required","errorCode":null,"errorMessage":"Chat ID is required","messagePattern":"Chat ID is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/MicrosoftTeams/core.ts","lineNumber":606,"sourceCode":"            name: 'get_chat',\n            description: 'Get details of a specific chat',\n            schema: z.object({\n                chatId: z.string().describe('ID of the chat to retrieve')\n            }),\n            baseUrl: BASE_URL,\n            method: 'GET',\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 } = params\n\n        if (!chatId) {\n            throw new Error('Chat ID is required')\n        }\n\n        try {\n            const endpoint = `/chats/${chatId}`\n            const result = await this.makeTeamsRequest(endpoint)\n\n            return this.formatResponse(\n                {\n                    success: true,\n                    chat: result\n                },\n                params\n            )\n        } catch (error) {\n            return this.formatResponse(`Error getting chat: ${error}`, params)\n        }\n    }\n}","sourceCodeStart":588,"sourceCodeEnd":624,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/MicrosoftTeams/core.ts#L588-L624","documentation":"Thrown synchronously by GetChatTool._call when chatId is falsy after the params merge. Above the try block at core.ts:605, propagates as a raw Error. zod schema (core.ts:590) marks chatId required. Graph chat IDs are GUID-shaped strings emitted by the /me/chats endpoint.","triggerScenarios":"get_chat invoked without chatId; defaultParams clobbering chatId; agent confusing chatId with teamId/channelId/messageId.","commonSituations":"Agent omitting chatId; defaultParams misconfiguration; UI form cleared; reused defaultParams from a chat tool being applied to a channel tool.","solutions":["Pass chatId explicitly — obtain it first via list_chats if unknown.","Fix the params spread order so caller args win over defaults.","Catch the propagated Error upstream.","Validate chatId is a non-empty string before invoking."],"exampleFix":"// before\nconst params = { ...arg, ...this.defaultParams }\n\n// after\nconst params = { ...this.defaultParams, ...arg }","handlingStrategy":"validation","validationCode":"function validateGetChatInput(input: unknown) {\n  const { chatId } = (input ?? {}) as any\n  if (typeof chatId !== 'string' || !chatId.trim()) throw new Error('chatId required')\n  if (!/^[0-9a-f_]{19,}$/i.test(chatId)) console.warn('chatId does not look like a Graph chat id')\n}","typeGuard":"function isGetChatArgs(x: unknown): x is { chatId: string } {\n  return typeof x === 'object' && x !== null &&\n    typeof (x as any).chatId === 'string' && (x as any).chatId.trim() !== ''\n}","tryCatchPattern":"try {\n  if (!isGetChatArgs(input)) return { error: 'chatId required' }\n  return JSON.parse((await getChatTool.invoke(input)).split(TOOL_ARGS_PREFIX)[0])\n} catch (e) {\n  return { error: (e as Error).message }\n}","preventionTips":["Obtain chatId via list_chats rather than free-text input.","Audit defaultParams for stray chatId entries.","Wrap tool invocations in a top-level catch since validation throws escape _call."],"tags":["validation","microsoft-teams","required-field","chat"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}