Skip to main content
Langmail classifies every incoming message into a category and flags the ones that need action. Your agent can use those labels as structured search filters instead of paging through an inbox. This guide shows common tasks as the prompt you give, the tool call the agent makes, and what comes back. The three email tools divide the work:

Find what needs action

Prompt
What's on my email to-do list from the last week?
The agent combines the todo category with a date filter:
Tool call — search_emails
{
  "keywords": ["todo"],
  "after": "2026-06-30T00:00:00Z"
}
Result
2 message(s) matched:

1. Please confirm your new contract
   id: Mf31a
   from: HR <hr@acme.example>
   date: 2026-07-03T09:20:00Z
   tags: direct, todo

2. Your domain renewal expires soon
   id: Mf2c8
   from: Registrar <noreply@registrar.example>
   date: 2026-07-01T12:05:00Z
   tags: notification, todo

Filter by category

The keywords filter takes any of the classification values — direct, receipt, newsletter, notification, promotional, plus the orthogonal todo flag — combined with OR:
Prompt
Collect all receipts from June for my expense report.
Tool call — search_emails
{
  "keywords": ["receipt"],
  "after": "2026-06-01T00:00:00Z",
  "before": "2026-07-01T00:00:00Z",
  "limit": 100
}
What the categories mean and how they get applied is covered in Email intelligence.

Search by sender and text

from matches a substring of the sender’s name or address; query is full-text over subject and body. They compose:
Prompt
Find the message from Jonas about the offsite budget.
Tool call — search_emails
{
  "from": "jonas",
  "query": "offsite budget"
}

Read the full message

Search results are deliberately body-free to stay light on tokens. The agent opens a specific hit by id:
Tool call — get_email
{ "id": "Mf31a" }
Result
Subject: Please confirm your new contract
From: HR <hr@acme.example>
To: you@langmail.me
Date: 2026-07-03T09:20:00Z
Tags: direct, todo

Hi,

please review the attached contract draft and confirm by Friday.
...

Follow a conversation

Given any message id, get_thread returns the whole conversation oldest-first, so the agent can reconstruct context before answering:
Tool call — get_thread
{ "id": "Mf31a" }
Result
3 message(s) in thread:

1. Contract renewal timeline
   id: Mf2f0
   from: HR <hr@acme.example>
   date: 2026-06-28T10:00:00Z
   tags: direct

2. Re: Contract renewal timeline
   id: Mf2f4
   from: You <you@langmail.me>
   date: 2026-06-28T14:12:00Z

3. Please confirm your new contract  ← requested
   id: Mf31a
   from: HR <hr@acme.example>
   date: 2026-07-03T09:20:00Z
   tags: direct, todo
The email surface is read-only: agents can search and read but not send, draft, or delete mail. If a to-do needs a reply, the agent drafts the text and you send it from webmail or your mail client.