Skip to content

Add send_to_conversation MCP tool#6

Open
latentoperator wants to merge 2 commits intoMaxGhenis:mainfrom
latentoperator:add-send-to-conversation
Open

Add send_to_conversation MCP tool#6
latentoperator wants to merge 2 commits intoMaxGhenis:mainfrom
latentoperator:add-send-to-conversation

Conversation

@latentoperator
Copy link

Summary

  • Adds a new send_to_conversation MCP tool that sends messages using a conversation ID instead of requiring a phone number
  • Enables AI assistants to reply to conversations directly after list_conversations, without needing to resolve the recipient's phone number via list_contacts
  • Follows the same pattern as the existing web API send endpoint (/api/conversations/:id/send)

Motivation

When an AI assistant sees an incoming message via list_conversationsget_conversation, the natural next step is to reply. Currently, the only way to send is via send_message which requires a phone number. This forces a detour through list_contacts to look up the number by name — which fails if the contact isn't synced or the name doesn't match exactly.

send_to_conversation closes this gap by accepting the conversation ID that the assistant already has.

Implementation

The handler reuses the same web.BuildSendPayload helper and GetConversation → participant/SIM resolution pattern used by the web API's send endpoint. Includes tests for validation and not-connected cases.

Test plan

  • send_to_conversation with valid conversation ID sends message
  • Missing conversation_id returns validation error
  • Missing message returns validation error
  • Not connected to Google Messages returns appropriate error
  • Tool registers without panic in TestRegisterTools

🤖 Generated with Claude Code

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>
@vercel
Copy link

vercel bot commented Mar 4, 2026

@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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant