get_thread
Retrieve a complete email conversation thread in chronological order, showing sender, subject, and preview for each message to understand the full communication flow.
Instructions
Get a conversation thread with all its emails in chronological order. Shows the full conversation flow including sender, subject, and preview for each email.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inbox_id | Yes | Inbox ID (e.g. ibx_...) | |
| thread_id | Yes | Thread ID (e.g. thd_...) |
Implementation Reference
- src/index.ts:331-349 (handler)The handler function for 'get_thread' that retrieves the thread using an inbox object and formats the output.
}, async ({ inbox_id, thread_id }) => { const inbox = await getInbox(inbox_id); const thread = await inbox.getThread(thread_id); const emailLines = thread.emails.map( (e, i) => `${i + 1}. [${e.id}] From: ${e.from} | Subject: ${e.subject} | ${e.createdAt}` + (e.preview ? `\n Preview: ${e.preview.slice(0, 100)}...` : '') + (e.isInjectionRisk ? '\n ⚠️ INJECTION RISK' : ''), ); return { content: [ { type: 'text' as const, text: [ `Thread: ${thread.subject}`, `Thread ID: ${thread.id}`, `Emails: ${thread.emailCount}`, - src/index.ts:322-330 (registration)Registration of the 'get_thread' tool with its schema and description.
server.registerTool('get_thread', { title: 'Get Thread', description: 'Get a conversation thread with all its emails in chronological order. ' + 'Shows the full conversation flow including sender, subject, and preview for each email.', inputSchema: { inbox_id: z.string().describe('Inbox ID (e.g. ibx_...)'), thread_id: z.string().describe('Thread ID (e.g. thd_...)'), },