Skip to main content
Glama

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
NameRequiredDescriptionDefault
inbox_idYes
thread_idYes

Implementation Reference

  • 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.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.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, },

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/agentmail-to/agentmail-toolkit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server