get_email
Retrieve a specific email by ID with full body content formatted for LLM processing, using inbox and email identifiers.
Instructions
Get a single email by ID with full body in LLM-safe format.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inbox_id | Yes | Inbox ID (e.g. ibx_...) | |
| email_id | Yes | Email ID (e.g. eml_...) |
Implementation Reference
- src/index.ts:156-162 (registration)Registration of the get_email tool, including the schema.
server.registerTool('get_email', { title: 'Get Email', description: 'Get a single email by ID with full body in LLM-safe format.', inputSchema: { inbox_id: z.string().describe('Inbox ID (e.g. ibx_...)'), email_id: z.string().describe('Email ID (e.g. eml_...)'), }, - src/index.ts:163-180 (handler)The handler implementation for the get_email tool, which fetches and formats the email content.
}, async ({ inbox_id, email_id }) => { const inbox = await getInbox(inbox_id); const email = await inbox.getEmail(email_id); const parts: string[] = [ `Email ID: ${email.id}`, `From: ${email.from}`, `To: ${email.to.join(', ')}`, `Subject: ${email.subject}`, `Date: ${email.createdAt}`, email.isInjectionRisk ? `⚠️ INJECTION RISK (score: ${email.security.injectionRiskScore})` : '', ``, email.safeBodyForLLM(), ]; if (email.attachments && email.attachments.length > 0) { parts.push('', 'Attachments:'); for (const att of email.attachments) {