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,
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states the basic action without disclosing behavioral traits such as read-only nature, error handling, permissions needed, or response format. It lacks details on what 'get' involves beyond the minimal statement.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with zero waste—just four words. It's front-loaded and to the point, though this brevity contributes to gaps in other dimensions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't cover what the tool returns, error conditions, or how it fits with sibling tools, making it inadequate for a tool with two required parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but adds no meaning beyond the schema. It mentions 'by ID' which implies thread_id, but doesn't explain inbox_id or the relationship between parameters, leaving semantics unclear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get thread by ID' clearly states the action (get) and resource (thread), but it's vague about what 'get' entails (retrieve details, fetch metadata, etc.) and doesn't differentiate from siblings like 'getMessage' or 'listThreads'. It's functional but lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'listThreads' or 'getMessage', nor does it mention prerequisites (e.g., needing an inbox_id and thread_id). The description assumes context without explicit instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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