{"record":{"id":"1a138c1bf3efcf95","repo":"FlowiseAI/Flowise","slug":"chat-channel-id-and-message-body-are-required","errorCode":null,"errorMessage":"Chat/Channel ID and Message Body are required","messagePattern":"Chat/Channel ID and Message Body are required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/MicrosoftTeams/core.ts","lineNumber":1143,"sourceCode":"                chatChannelId: z.string().describe('ID of the chat or channel to send message to'),\n                teamId: z.string().optional().describe('ID of the team (required for channel messages)'),\n                messageBody: z.string().describe('Content of the message'),\n                contentType: z.enum(['text', 'html']).optional().default('text').describe('Content type of the message')\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 { chatChannelId, teamId, messageBody, contentType = 'text' } = params\n\n        if (!chatChannelId || !messageBody) {\n            throw new Error('Chat/Channel ID and Message Body are required')\n        }\n\n        try {\n            const body = {\n                body: {\n                    contentType,\n                    content: messageBody\n                }\n            }\n\n            let endpoint: string\n            if (teamId) {\n                // Channel message\n                endpoint = `/teams/${teamId}/channels/${chatChannelId}/messages`\n            } else {\n                // Chat message\n                endpoint = `/chats/${chatChannelId}/messages`\n            }","sourceCodeStart":1125,"sourceCodeEnd":1161,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/MicrosoftTeams/core.ts#L1125-L1161","documentation":"Thrown by the SendMessage Teams tool's _call when chatChannelId or messageBody is falsy. The tool creates a message in a channel (POST /teams/{teamId}/channels/{chatChannelId}/messages) or chat (POST /chats/{chatChannelId}/messages) with a body of { contentType, content }. The destination scope ID and the text content are both required.","triggerScenarios":"Calling SendMessage without chatChannelId or messageBody; passing an empty string for the body; defaultParams not configured.","commonSituations":"Agent attempts to send a message but produces an empty body; chatChannelId variable resolved empty after upstream failure; node input left unbound.","solutions":["Pass a non-empty chatChannelId and a non-empty messageBody.","For channel sends, also include teamId.","Optionally pass contentType ('text' or 'html'); defaults to 'text'.","Validate the agent's generated body is non-empty before invoking the tool."],"exampleFix":"// before\nawait sendTool._call({ chatChannelId: '19:...' })\n// after\nawait sendTool._call({ chatChannelId: '19:...', teamId: 'team-guid', messageBody: 'Hello team', contentType: 'text' })","handlingStrategy":"validation","validationCode":"function hasScopeAndBody(params: any): boolean {\n  return Boolean(params && params.chatChannelId && params.messageBody)\n}","typeGuard":"function isSendArgs(a: unknown): a is { chatChannelId: string; messageBody: string; teamId?: string; contentType?: string } {\n  return typeof a === 'object' && a !== null\n    && typeof (a as any).chatChannelId === 'string' && (a as any).chatChannelId.length > 0\n    && typeof (a as any).messageBody === 'string' && (a as any).messageBody.length > 0\n}","tryCatchPattern":"try {\n  await sendTool.call(arg)\n} catch (e) {\n  if (e instanceof Error && e.message === 'Chat/Channel ID and Message Body are required') {\n    // request scope and body\n  } else throw e\n}","preventionTips":["Validate the agent's generated messageBody is non-empty before invoking.","Expose chatChannelId and messageBody as required in the agent schema."],"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"}