FlowiseAI/Flowise · error · Error

Chat/Channel ID, Message ID, and Reply Body are required

Error message

Chat/Channel ID, Message ID, and Reply Body are required

What it means

Thrown by the SendReply Teams tool's _call when chatChannelId, messageId, or replyBody is falsy. The tool posts a reply to a message in a channel (POST /teams/{teamId}/channels/{chatChannelId}/messages/{messageId}/replies) or chat (POST /chats/{chatChannelId}/messages/{messageId}/replies) with body { contentType, content: replyBody }. All three identifiers/content fields are required.

Source

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

                teamId: z.string().optional().describe('ID of the team (required for channel messages)'),
                messageId: z.string().describe('ID of the message to reply to'),
                replyBody: z.string().describe('Content of the reply'),
                contentType: z.enum(['text', 'html']).optional().default('text').describe('Content type of the reply')
            }),
            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, messageId, replyBody, contentType = 'text' } = params

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

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

            let endpoint: string
            if (teamId) {
                // Channel message reply
                endpoint = `/teams/${teamId}/channels/${chatChannelId}/messages/${messageId}/replies`
            } else {
                // For chat messages, replies are just new messages
                endpoint = `/chats/${chatChannelId}/messages`
            }

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Pass non-empty chatChannelId, messageId, and replyBody.
  2. For channel replies, also pass teamId.
  3. Optionally pass contentType ('text' or 'html'); defaults to 'text'.
  4. Validate the agent's replyBody is non-empty before invoking.

Example fix

// before
await replyTool._call({ chatChannelId: '19:...', replyBody: 'Got it' })
// after
await replyTool._call({ chatChannelId: '19:...', teamId: 'team-guid', messageId: '1701234567890', replyBody: 'Got it' })
Defensive patterns

Strategy: validation

Validate before calling

function hasScopeMessageAndReply(params: any): boolean {
  return Boolean(params && params.chatChannelId && params.messageId && params.replyBody)
}

Type guard

function isReplyArgs(a: unknown): a is { chatChannelId: string; messageId: string; replyBody: 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).messageId === 'string' && (a as any).messageId.length > 0
    && typeof (a as any).replyBody === 'string' && (a as any).replyBody.length > 0
}

Try / catch

try {
  await replyTool.call(arg)
} catch (e) {
  if (e instanceof Error && e.message === 'Chat/Channel ID, Message ID, and Reply Body are required') {
    // request all three
  } else throw e
}

Prevention

When it happens

Trigger: Calling SendReply without chatChannelId, messageId, or replyBody; any of the three empty/null; defaultParams not filling the gap.

Common situations: Agent generates an empty reply body; messageId of the parent message was lost from a prior step; chatChannelId variable resolved empty.

Related errors


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