FlowiseAI/Flowise · error · Error

Chat/Channel ID and Message Body are required

Error message

Chat/Channel ID and Message Body are required

What it means

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.

Source

Thrown at packages/components/nodes/tools/MicrosoftTeams/core.ts:1143

                chatChannelId: z.string().describe('ID of the chat or channel to send message to'),
                teamId: z.string().optional().describe('ID of the team (required for channel messages)'),
                messageBody: z.string().describe('Content of the message'),
                contentType: z.enum(['text', 'html']).optional().default('text').describe('Content type of the message')
            }),
            baseUrl: BASE_URL,
            method: 'POST',
            headers: {}
        }

        super({ ...toolInput, accessToken: args.accessToken, defaultParams: args.defaultParams })
    }

    protected async _call(arg: any): Promise<string> {
        const params = { ...arg, ...this.defaultParams }
        const { chatChannelId, teamId, messageBody, contentType = 'text' } = params

        if (!chatChannelId || !messageBody) {
            throw new Error('Chat/Channel ID and Message Body are required')
        }

        try {
            const body = {
                body: {
                    contentType,
                    content: messageBody
                }
            }

            let endpoint: string
            if (teamId) {
                // Channel message
                endpoint = `/teams/${teamId}/channels/${chatChannelId}/messages`
            } else {
                // Chat message
                endpoint = `/chats/${chatChannelId}/messages`
            }

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Pass a non-empty chatChannelId and a non-empty messageBody.
  2. For channel sends, also include teamId.
  3. Optionally pass contentType ('text' or 'html'); defaults to 'text'.
  4. Validate the agent's generated body is non-empty before invoking the tool.

Example fix

// before
await sendTool._call({ chatChannelId: '19:...' })
// after
await sendTool._call({ chatChannelId: '19:...', teamId: 'team-guid', messageBody: 'Hello team', contentType: 'text' })
Defensive patterns

Strategy: validation

Validate before calling

function hasScopeAndBody(params: any): boolean {
  return Boolean(params && params.chatChannelId && params.messageBody)
}

Type guard

function isSendArgs(a: unknown): a is { chatChannelId: string; messageBody: string; teamId?: string; contentType?: string } {
  return typeof a === 'object' && a !== null
    && typeof (a as any).chatChannelId === 'string' && (a as any).chatChannelId.length > 0
    && typeof (a as any).messageBody === 'string' && (a as any).messageBody.length > 0
}

Try / catch

try {
  await sendTool.call(arg)
} catch (e) {
  if (e instanceof Error && e.message === 'Chat/Channel ID and Message Body are required') {
    // request scope and body
  } else throw e
}

Prevention

When it happens

Trigger: Calling SendMessage without chatChannelId or messageBody; passing an empty string for the body; defaultParams not configured.

Common situations: Agent attempts to send a message but produces an empty body; chatChannelId variable resolved empty after upstream failure; node input left unbound.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/1a138c1bf3efcf95. Report an issue: GitHub.