get_inbox
Retrieve inbox details and a list of received emails for a given inbox ID, enabling verification of incoming messages and extraction of codes.
Instructions
Get inbox details and list of received emails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inbox_id | Yes | The inbox ID |
Implementation Reference
- mcp-server/src/index.ts:98-108 (registration)Registration of the 'get_inbox' tool via server.tool(), with its name, description, schema (inbox_id), and handler.
server.tool( "get_inbox", "Get inbox details and list of received emails.", { inbox_id: z.string().describe("The inbox ID"), }, async ({ inbox_id }) => { const result = await blipFetch(`/v1/inboxes/${inbox_id}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } ); - mcp-server/src/index.ts:104-107 (handler)Handler function that calls blipFetch to GET /v1/inboxes/{inbox_id} and returns JSON result.
async ({ inbox_id }) => { const result = await blipFetch(`/v1/inboxes/${inbox_id}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } - mcp-server/src/index.ts:101-103 (schema)Input schema: inbox_id (required z.string) parameter validated by Zod.
{ inbox_id: z.string().describe("The inbox ID"), }, - mcp-server/src/index.ts:24-45 (helper)Helper function blipFetch used by the handler to make authenticated API calls to the Blip API.
async function blipFetch( path: string, options: RequestInit = {} ): Promise<unknown> { const url = `${API_URL}${path}`; const res = await fetch(url, { ...options, headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json", ...options.headers, }, }); if (!res.ok) { const body = await res.text(); throw new Error(`Blip API error ${res.status} on ${options.method || "GET"} ${path}: ${body}`); } if (res.status === 204) return null; return res.json(); }