docs: clarify search_emails scope, point to advanced_search#58
Closed
AusDavo wants to merge 4 commits into
Closed
Conversation
Add StreamableHTTPServerTransport as an alternative to stdio, enabling deployment as a standalone HTTP service. Includes bearer token auth, health check endpoint, Dockerfile with multi-stage build, and docker-compose config for Caddy integration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The MCP SDK does not allow connecting multiple transports to a single Server instance. Each new HTTP session was calling server.connect() on the shared instance, causing "Already connected to a transport" crashes after the first connection. Wrap server creation and handler registration in a createMcpServer() factory so each HTTP session gets its own Server+transport pair. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The search_emails tool description said "Search emails by subject or content" which implied it could filter by sender or other fields. In practice it only passes the query to JMAP's `text` filter (body and subject full-text search). AI clients consistently try `from:` syntax or sender names, get zero results, and fall back to get_recent_emails. Updated the tool and parameter descriptions to make the scope explicit and direct users to advanced_search for field-specific filtering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
|
Thanks @AusDavo — the description clarification is a genuinely good catch and it's now on main (adapted with attribution). Closing this PR rather than merging because it had grown beyond the docs scope (Dockerfile, docker-compose, an HTTP transport rewrite) and had conflicts with main. If you'd like to propose the Docker/HTTP-transport work, a fresh focused PR for each would be very welcome. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
search_emailstool description from the vague "Search emails by subject or content" to explicitly state it only does full-text body/subject search, and directs users toadvanced_searchfor field-specific filtering (sender, recipient, date, etc.)queryparameter description from "Search query string" to "Text to search for in email body and subject lines"Problem
AI clients (Claude, etc.) consistently misuse
search_emailsby passing structured queries likefrom:user@example.comor sender names, expecting it to filter by sender. The tool silently returns zero results because JMAP'stextfilter only matches body/subject content. The client then has to fall back toget_recent_emailsand scan manually.The
advanced_searchtool already supportsfrom,to,subject, and date parameters — but nothing insearch_emailstells the client it exists or thatsearch_emailscan't do field-specific filtering.Fix
Two description changes in the tool definition (no logic changes):
"Full-text search of email body and subject. Does not filter by sender, recipient, or date — use advanced_search for field-specific filtering.""Text to search for in email body and subject lines"Test plan
npm run buildpasses cleanlyadvanced_searchinstead ofsearch_emailswhen filtering by sender/recipient🤖 Generated with Claude Code