FlowiseAI/Flowise · error · Error
Chat ID is required
Error message
Chat ID is required
What it means
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.
Source
Thrown at packages/components/nodes/tools/MicrosoftTeams/core.ts:606
name: 'get_chat',
description: 'Get details of a specific chat',
schema: z.object({
chatId: z.string().describe('ID of the chat to retrieve')
}),
baseUrl: BASE_URL,
method: 'GET',
headers: {}
}
super({ ...toolInput, accessToken: args.accessToken, defaultParams: args.defaultParams })
}
protected async _call(arg: any): Promise<string> {
const params = { ...arg, ...this.defaultParams }
const { chatId } = params
if (!chatId) {
throw new Error('Chat ID is required')
}
try {
const endpoint = `/chats/${chatId}`
const result = await this.makeTeamsRequest(endpoint)
return this.formatResponse(
{
success: true,
chat: result
},
params
)
} catch (error) {
return this.formatResponse(`Error getting chat: ${error}`, params)
}
}
}View on GitHub (pinned to abe4a8601a)
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.
Example fix
// before
const params = { ...arg, ...this.defaultParams }
// after
const params = { ...this.defaultParams, ...arg } Defensive patterns
Strategy: validation
Validate before calling
function validateGetChatInput(input: unknown) {
const { chatId } = (input ?? {}) as any
if (typeof chatId !== 'string' || !chatId.trim()) throw new Error('chatId required')
if (!/^[0-9a-f_]{19,}$/i.test(chatId)) console.warn('chatId does not look like a Graph chat id')
} Type guard
function isGetChatArgs(x: unknown): x is { chatId: string } {
return typeof x === 'object' && x !== null &&
typeof (x as any).chatId === 'string' && (x as any).chatId.trim() !== ''
} Try / catch
try {
if (!isGetChatArgs(input)) return { error: 'chatId required' }
return JSON.parse((await getChatTool.invoke(input)).split(TOOL_ARGS_PREFIX)[0])
} catch (e) {
return { error: (e as Error).message }
} Prevention
- 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.
When it happens
Trigger: get_chat invoked without chatId; defaultParams clobbering chatId; agent confusing chatId with teamId/channelId/messageId.
Common situations: Agent omitting chatId; defaultParams misconfiguration; UI form cleared; reused defaultParams from a chat tool being applied to a channel tool.
Related errors
- Members list is required to create a chat
- Topic is required to update a chat
- Team ID is required to list channels
- Both Team ID and Channel ID are required
- Team ID and Display Name are required to create a channel
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/8bc935a4f1da88bd.
Report an issue: GitHub.