Feature/native mcp server 2#26
Merged
qasim-nylas merged 7 commits intofeature/native-mcp-serverfrom Feb 27, 2026
Merged
Conversation
Validate jsonrpc=="2.0" and non-empty method after unmarshal, returning -32600 Invalid Request for malformed requests. Add additionalProperties: false to all 47 tool input schemas for stricter client compliance.
…ol error code Add MCP spec compliance improvements: tool annotations with behavior hints (readOnly, destructive, idempotent, openWorld) and human-readable titles for all 47 tools; protocol version negotiation supporting both 2024-11-05 and 2025-06-18; proper JSON-RPC -32602 error for unknown tools. Split tools.go into tools_registry.go and tools_annotations.go to stay within file size limits.
Change protocol version from non-existent "2025-06-18" to "2025-03-26" (the actual MCP spec version that introduced tool annotations). Add explicit destructiveHint: false to non-destructive mutating tools (send/create/update/smart_compose) since the spec default is true. Add idempotentHint: true to update_* tools for PUT-like semantics.
Shorten tool descriptions and property descriptions across all 47 tools. Optimize annotations by omitting openWorldHint (MCP spec default is true) and using pre-allocated singletons. Compact grantDesc, epochDesc constants and share participantItems schema. Saves ~1,200 tokens per session.
Add cleanSnippet to strip invisible chars and cap snippet length at 120 chars in list_messages responses. Remove redundant folders field from list output. Add comprehensive JSON-RPC validation tests and tool schema tests.
Refactor doRequest to return the timeout context's cancel function so callers can defer cancellation after reading the response body. Prevents premature context cancellation causing io.ReadAll failures. Update all call sites across adapters.
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.
No description provided.