Skip to main content
Glama

listThreads

Retrieve email threads by inbox ID for AI agents using AgentMail. Specify inbox ID, limit, and offset to organize and manage communication effectively.

Instructions

List threads by inbox ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inbox_idYes
limitNo
offsetNo

Implementation Reference

  • Node.js handler function for the 'list_threads' tool. Extracts inbox_id and options from args and calls client.inboxes.threads.list(inbox_id, options).
    export async function listThreads(client: AgentMailClient, args: Args) {
        const { inbox_id, ...options } = args
        return client.inboxes.threads.list(inbox_id, options)
    }
  • Python handler function for the 'list_threads' tool. Calls client.inboxes.threads.list with unpacked kwargs.
    def list_threads(client: AgentMail, kwargs: Kwargs):
        return client.inboxes.threads.list(**kwargs)
  • Node.js registration of the 'list_threads' tool, specifying name, description, params_schema, and func.
    {
        name: 'list_threads',
        description: 'List threads in inbox',
        params_schema: ListInboxItemsParams,
        func: listThreads,
    },
  • Python registration of the 'list_threads' tool as a Tool instance with name, description, params_schema, and func.
    Tool(
        name="list_threads",
        description="List threads in inbox",
        params_schema=ListInboxItemsParams,
        func=list_threads,
    ),
Behavior1/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It doesn't mention whether this is a read-only operation, if it requires authentication, what the return format looks like, or any rate limits. The description fails to compensate for the lack of annotations.

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 a single, efficient sentence with no wasted words. It's appropriately sized and front-loaded with the core purpose, though it could benefit from additional context.

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 the complexity (3 parameters, 0% schema coverage, no annotations, no output schema), the description is incomplete. It doesn't explain the tool's behavior, return values, or parameter details beyond the basic filter, making it inadequate for effective agent use.

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 only partially does so. It mentions 'by inbox ID' which clarifies the required inbox_id parameter, but doesn't explain limit or offset (pagination parameters) or their default behaviors. This leaves two of three parameters inadequately documented.

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 'List threads by inbox ID' clearly states the action (list) and resource (threads), but it's vague about scope and doesn't differentiate from sibling tools like listMessages or listInboxes. It specifies the primary filter (inbox_id) but lacks detail about what 'list' entails.

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 listMessages (which might list messages across threads) or getThread (which retrieves a single thread). The description implies usage with an inbox_id but doesn't specify prerequisites or exclusions.

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