{"record":{"id":"ba795a95c04ecfa1","repo":"FlowiseAI/Flowise","slug":"chat-or-channel-id-is-required","errorCode":null,"errorMessage":"Chat or Channel ID is required","messagePattern":"Chat or Channel ID is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/MicrosoftTeams/core.ts","lineNumber":1037,"sourceCode":"            schema: z.object({\n                chatChannelId: z.string().describe('ID of the chat or channel to list messages from'),\n                teamId: z.string().optional().describe('ID of the team (required for channel messages)'),\n                maxResults: z.number().optional().default(50).describe('Maximum number of messages to return')\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 { chatChannelId, teamId, maxResults = 50 } = params\n\n        if (!chatChannelId) {\n            throw new Error('Chat or Channel ID is required')\n        }\n\n        try {\n            let endpoint: string\n            if (teamId) {\n                // Channel messages\n                endpoint = `/teams/${teamId}/channels/${chatChannelId}/messages?$top=${maxResults}`\n            } else {\n                // Chat messages\n                endpoint = `/chats/${chatChannelId}/messages?$top=${maxResults}`\n            }\n\n            const result = await this.makeTeamsRequest(endpoint)\n\n            return this.formatResponse(\n                {\n                    success: true,\n                    messages: result.value || [],","sourceCodeStart":1019,"sourceCodeEnd":1055,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/MicrosoftTeams/core.ts#L1019-L1055","documentation":"Thrown by the ListMessages Teams tool's _call when chatChannelId is falsy after merging the argument with defaultParams. The tool lists messages from either a channel (GET /teams/{teamId}/channels/{chatChannelId}/messages) when teamId is present, or a chat (GET /chats/{chatChannelId}/messages). chatChannelId is required; teamId is optional and only switches the endpoint shape.","triggerScenarios":"Calling ListMessages without chatChannelId; passing an empty/null chatChannelId; defaultParams not configured with it.","commonSituations":"Agent invokes the list tool without specifying which chat/channel to read; the chatChannelId variable resolved empty after an upstream failure; the node's input was left unbound.","solutions":["Supply a non-empty chatChannelId in the tool payload.","If listing channel messages, also supply teamId; for chat messages it can be omitted.","Set chatChannelId in defaultParams when it is constant for the run.","Expose chatChannelId as required in the agent's tool schema."],"exampleFix":"// before\nawait listTool._call({})\n// after\nawait listTool._call({ chatChannelId: '19:chat...', teamId: 'team-guid' })","handlingStrategy":"validation","validationCode":"function hasChatChannelId(params: any): boolean {\n  return Boolean(params && params.chatChannelId)\n}","typeGuard":"function isListMessagesArgs(a: unknown): a is { chatChannelId: string; teamId?: string } {\n  return typeof a === 'object' && a !== null\n    && typeof (a as any).chatChannelId === 'string' && (a as any).chatChannelId.length > 0\n}","tryCatchPattern":"try {\n  await listTool.call(arg)\n} catch (e) {\n  if (e instanceof Error && e.message === 'Chat or Channel ID is required') {\n    // request chatChannelId\n  } else throw e\n}","preventionTips":["Expose chatChannelId as required in the agent schema.","Supply teamId when targeting a channel rather than a chat."],"tags":["microsoft-teams","validation","graph-api","missing-argument"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}