Skip to main content
Glama
himalaya-mcp

himalaya-mcp

by Data-Wise

search_emails

Search emails by subject, sender, recipient, body, date, or flag using himalaya filter syntax with and/or/not conditions and sorted results.

Instructions

Search emails using himalaya filter syntax. Combine conditions with and/or (REQUIRED between every condition pair — omitting them causes parse errors). Negate any condition with not. Multi-word values: quote them or backslash-escape the spaces. Sort results with order by <date|from|to|subject> <asc|desc>. Conditions: subject, from, to, body, date (exact day), after (strictly after), flag. Flag values: seen, answered, flagged, draft, deleted. On himalaya v2 every word must belong to a condition (no bare words: use subject <word>), and there is no before: use not after <date>.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "search_emails"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesSearch query. Use `and`/`or` between every condition pair (e.g. 'from alice and after 2026-07-01'; NOT 'from alice after 2026-07-01'). Negate with `not` (e.g. 'not from spammer', 'not flag seen'). Multi-word values: quote them ('subject "quarterly report"') or backslash-escape the spaces ('subject quarterly\ report'). Older than a date: 'not after 2026-06-30' (there is no `before` on himalaya v2). Always name the field ('subject invoice', 'body invoice'): bare words are rejected on v2. Sort with 'order by date desc'. Full example: 'subject invoice and after 2026-01-01 order by date desc'.
folderNoFolder to search in (default: INBOX)
accountNoAccount name (uses default if omitted)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.2.2
    • changedInput schema / properties / query / description
      Previous value: -"Search query. Use `and`/`or` between every condition pair (e.g. 'from alice and after 2026-07-01'; NOT 'from alice after 2026-07-01'). Negate with `not` (e.g. 'not from spammer', 'not body spam'). Multi-word values: backslash-escape spaces ('subject quarterly\\ report'). Bare words default to subject search; use 'body <word>' for body text. Sort with 'order by date desc', 'order by subject asc', etc. Full example: 'subject invoice and after 2026-01-01 order by date desc'."New value: +"Search query. Use `and`/`or` between every condition pair (e.g. 'from alice and after 2026-07-01'; NOT 'from alice after 2026-07-01'). Negate with `not` (e.g. 'not from spammer', 'not flag seen'). Multi-word values: quote them ('subject \"quarterly report\"') or backslash-escape the spaces ('subject quarterly\\ report'). Older than a date: 'not after 2026-06-30' (there is no `before` on himalaya v2). Always name the field ('subject invoice', 'body invoice'): bare words are rejected on v2. Sort with 'order by date desc'. Full example: 'subject invoice and after 2026-01-01 order by date desc'."
  2. Changed1 schema field changedv2.0.2
    • changedInput schema / properties / query / description
      Previous value: -"Search query in himalaya filter syntax (e.g. 'subject invoice', 'from alice and subject meeting')"New value: +"Search query. Use `and`/`or` between every condition pair (e.g. 'from alice and after 2026-07-01'; NOT 'from alice after 2026-07-01'). Negate with `not` (e.g. 'not from spammer', 'not body spam'). Multi-word values: backslash-escape spaces ('subject quarterly\\ report'). Bare words default to subject search; use 'body <word>' for body text. Sort with 'order by date desc', 'order by subject asc', etc. Full example: 'subject invoice and after 2026-01-01 order by date desc'."
  3. First observedv1.7.0

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden, and it does disclose meaningful behavioral traits: missing `and`/`or` causes parse errors, bare words are rejected on v2, and `before` does not exist. It still omits result limits, pagination, default sort order, and whether the search is read-only over the whole account or restricted to a folder.

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

Conciseness3/5

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

The purpose is front-loaded and every sentence is about the query language, but the bulk duplicates the already very detailed `query` schema description. A single reference to the grammar plus the non-obvious pitfalls (v2 bare words, no `before`) would have carried the same information more cheaply.

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?

For a tool whose main complexity is a query mini-language, the description covers the grammar, negation, quoting, sorting, and version-specific pitfalls thoroughly, and folder/account are documented in the schema. With no output schema, the return shape and any result cap go unmentioned, which is the only notable omission.

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 `query` parameter description already spells out the and/or/not rules, quoting, and ordering. The description adds the enumerated condition list and the valid flag values (seen, answered, flagged, draft, deleted), which the schema does not enumerate, but the rest is largely restatement.

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

Purpose4/5

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

The first clause states a specific verb and resource: 'Search emails using himalaya filter syntax'. An agent immediately knows this is a filtered retrieval tool. It does not, however, distinguish itself from siblings like list_emails, list_starred, or list_threads, so an agent must infer that this is the tool for arbitrary query expressions rather than curated lists.

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?

The description is almost entirely query grammar; it never says when to reach for this tool instead of list_emails, list_starred, or list_threads. There is implicit guidance ('Search emails using...'), but no explicit when/when-not or alternative routing, which is a real gap given how many retrieval siblings exist.

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