getThread
Retrieve a specific email thread by providing the inbox and thread ID, enabling AI agents to access and manage conversations within isolated inboxes.
Instructions
Get thread by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inbox_id | Yes | ||
| thread_id | Yes |
Implementation Reference
- node/src/functions.ts:38-41 (handler)Node.js implementation of the getThread handler function, which retrieves a thread from an inbox using the AgentMailClient by extracting inbox_id and thread_id from args and calling the client's threads.get method.export async function getThread(client: AgentMailClient, args: Args) { const { inbox_id, thread_id, ...options } = args return client.inboxes.threads.get(inbox_id, thread_id, options) }
- Python implementation of the get_thread handler function, which retrieves a thread using the AgentMail client by passing kwargs to the client's threads.get method.def get_thread(client: AgentMail, kwargs: Kwargs): return client.inboxes.threads.get(**kwargs)
- node/src/schemas.ts:30-33 (schema)Node.js Zod schema for GetThreadParams, defining inbox_id and thread_id as required string fields.export const GetThreadParams = z.object({ inbox_id: InboxIdSchema, thread_id: ThreadIdSchema, })
- Python Pydantic model for GetThreadParams, defining inbox_id and thread_id as required fields.class GetThreadParams(BaseModel): inbox_id: InboxIdField thread_id: ThreadIdField
- node/src/tools.ts:66-71 (registration)Node.js registration of the 'get_thread' tool in the tools array, linking the name, description, GetThreadParams schema, and getThread function.{ name: 'get_thread', description: 'Get thread', params_schema: GetThreadParams, func: getThread, },