Add send_to_conversation MCP tool#6
Open
latentoperator wants to merge 2 commits intoMaxGhenis:mainfrom
Open
Conversation
Adds a new MCP tool that sends messages using a conversation ID instead of requiring a phone number. This enables AI assistants to reply to conversations directly after listing them with list_conversations, without needing to look up the recipient's phone number separately. The implementation follows the same pattern as the web API's send endpoint, using GetConversation to resolve participant and SIM info. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@latentoperator is attempting to deploy a commit to the Max Ghenis' projects Team on Vercel. A member of the Team first needs to authorize it. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
send_to_conversationMCP tool that sends messages using a conversation ID instead of requiring a phone numberlist_conversations, without needing to resolve the recipient's phone number vialist_contacts/api/conversations/:id/send)Motivation
When an AI assistant sees an incoming message via
list_conversations→get_conversation, the natural next step is to reply. Currently, the only way to send is viasend_messagewhich requires a phone number. This forces a detour throughlist_contactsto look up the number by name — which fails if the contact isn't synced or the name doesn't match exactly.send_to_conversationcloses this gap by accepting the conversation ID that the assistant already has.Implementation
The handler reuses the same
web.BuildSendPayloadhelper andGetConversation→ participant/SIM resolution pattern used by the web API's send endpoint. Includes tests for validation and not-connected cases.Test plan
send_to_conversationwith valid conversation ID sends messageconversation_idreturns validation errormessagereturns validation errorTestRegisterTools🤖 Generated with Claude Code