Skip to main content
Glama

Search Emails

search_emails
Read-only

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results (default 50, max 200). Only override if user says specific number like "show me 10 emails". For vague quantities ("couple", "few", "recent"), omit this parameter to use default.
offsetNoRows to skip for paging (default 0). When the result is truncated, re-call with offset += limit to fetch the next page.
order_byNoSQL ORDER BY clause (default: email_datetime DESC)email_datetime DESC
on_behalf_ofNoA teammate's email (one with conversation sharing turned on), or an agency client's from list_agency_clients, to run this call in that account: their agents, settings, connected accounts, and credits. Omit it to act on your own account.
where_clauseYesSQL WHERE clause (without WHERE keyword). Use ONLY these columns: provider, sender_email, sender_email_lower (WHERE only; not returned; pass lowercased values), sender_name, recipients, is_outbound (BOOLEAN — true = sent from the connected mailbox, false = received), subject, content, email_datetime, attachments, reply_outcome (inbound replies only; '' / 'interested' / 'meeting_booked' / 'not_interested' — the reply's classified outcome). For participants, use sender_email_lower = ANY(ARRAY['foo@example.com', ...]). Resolve the email address first if you only have a name. For attachments JSONB, use: attachments::text ILIKE '%filename%' or attachments != '[]'::jsonb to find emails with attachments.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / on_behalf_of / description
      Previous value: -"Read a consented teammate's emails instead of your own — pass their email. Gated on that teammate's conversation-sharing setting; a teammate who hasn't shared is rejected. Omit for your own. Or pass an agency client's email, from list_agency_clients, to run the call in that client's account, where none of the teammate limits above apply."New value: +"A teammate's email (one with conversation sharing turned on), or an agency client's from list_agency_clients, to run this call in that account: their agents, settings, connected accounts, and credits. Omit it to act on your own account."
  2. Changed2 schema fields changed
    • removedInput schema / properties / as_teammate
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Read a consented teammate's emails instead of your own — pass their email. Gated on that teammate's conversation-sharing setting; a teammate who hasn't shared is rejected. Omit for your own."
      -}
    • addedInput schema / properties / on_behalf_of
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Read a consented teammate's emails instead of your own — pass their email. Gated on that teammate's conversation-sharing setting; a teammate who hasn't shared is rejected. Omit for your own. Or pass an agency client's email, from list_agency_clients, to run the call in that client's account, where none of the teammate limits above apply."
      +}
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

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

readOnlyHint=true already covers the safety profile, and the description adds genuinely useful behavior: results are truncated to 200 chars and content_length holds the true length. This extra context (truncation, how to get full data) goes beyond the annotation.

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

Conciseness4/5

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

Front-loaded summary with the key routing hint, and every sentence earns its place (truncation, column names, get_emails handoff). The nested XML tags add slight overhead but no real confusion.

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

Completeness4/5

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

There is no output schema, but the description compensates by describing the return dict (count, truncated, emails, content_length) and the truncation contract, which is what an agent needs to interpret results correctly.

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

Parameters3/5

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

Schema description coverage is 100% and the where_clause columns are exhaustively documented in the schema itself. The description only points the agent at that column list rather than adding new meaning, so the baseline 3 applies.

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

Purpose5/5

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

States a specific verb and resource ("Search user's emails from table_email_data") and explicitly distinguishes itself from the sibling get_emails by positioning itself as a truncated preview tool. An agent can tell what it does without opening the schema.

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

Usage Guidelines4/5

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

Explicitly names the alternative and its condition: use this for 200-char previews, call get_emails with the IDs for full content. This is clear routing guidance, though it doesn't cover how it relates to other search tools (e.g., search_chat_history, search_linkedin_message_history).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources