{"record":{"id":"b36e34fd2281a081","repo":"FlowiseAI/Flowise","slug":"both-chat-id-and-message-id-are-required","errorCode":null,"errorMessage":"Both Chat ID and Message ID are required","messagePattern":"Both Chat ID and Message ID are required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/MicrosoftTeams/core.ts","lineNumber":935,"sourceCode":"            description: 'Pin a message in a chat',\n            schema: z.object({\n                chatId: z.string().describe('ID of the chat'),\n                messageId: z.string().describe('ID of the message to pin')\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 { chatId, messageId } = params\n\n        if (!chatId || !messageId) {\n            throw new Error('Both Chat ID and Message ID are required')\n        }\n\n        try {\n            const body = {\n                message: {\n                    '@odata.bind': `https://graph.microsoft.com/v1.0/chats('${chatId}')/messages('${messageId}')`\n                }\n            }\n\n            const endpoint = `/chats/${chatId}/pinnedMessages`\n            await this.makeTeamsRequest(endpoint, 'POST', body)\n\n            return this.formatResponse(\n                {\n                    success: true,\n                    message: 'Message pinned successfully'\n                },\n                params","sourceCodeStart":917,"sourceCodeEnd":953,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/MicrosoftTeams/core.ts#L917-L953","documentation":"Thrown by the PinChatMessage Teams tool's _call when chatId or messageId is falsy after merging the argument with defaultParams. The tool pins an existing message in a chat via POST /chats/{chatId}/pinnedMessages with an odata.bind reference to the message. Both IDs are needed to build the reference URL and the endpoint.","triggerScenarios":"Calling PinChatMessage without chatId or messageId; either value empty/null; defaultParams not configured to fill the gap.","commonSituations":"Agent attempts to pin a message but only knows the chat, not the message id; the messageId was supposed to come from a prior 'send message' step that failed; node wiring leaves a required input unbound.","solutions":["Supply both chatId and messageId as non-empty strings in the tool payload.","Capture the messageId from the prior send/list message tool call and thread it into the pin call.","Set stable IDs in defaultParams when one is constant for the conversation.","Mark both fields required in the tool schema exposed to the agent."],"exampleFix":"// before\nawait pinTool._call({ chatId: '19:...' })\n// after\nconst sent = await sendTool._call({ chatChannelId: '19:...', messageBody: 'hi' })\nconst messageId = JSON.parse(sent).id\nawait pinTool._call({ chatId: '19:...', messageId })","handlingStrategy":"validation","validationCode":"function hasChatAndMessage(params: any): boolean {\n  return Boolean(params && params.chatId && params.messageId)\n}","typeGuard":"function isPinArgs(a: unknown): a is { chatId: string; messageId: string } {\n  return typeof a === 'object' && a !== null\n    && typeof (a as any).chatId === 'string' && (a as any).chatId.length > 0\n    && typeof (a as any).messageId === 'string' && (a as any).messageId.length > 0\n}","tryCatchPattern":"try {\n  await pinTool.call(arg)\n} catch (e) {\n  if (e instanceof Error && e.message === 'Both Chat ID and Message ID are required') {\n    // request both IDs\n  } else throw e\n}","preventionTips":["Thread messageId from the prior send/list step.","Expose chatId and messageId 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"}