From 1cabbae6b530590e85fa77eecfd7e9c16b9491ad Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Fri, 13 Mar 2026 19:51:42 +0200 Subject: [PATCH] fix: allow channel messages without specifying recipient in send_message MCP tool The `to` parameter was incorrectly marked as Required() in the MCP tool schema, preventing channel-only messages. The service layer already validates that either `to` or `channel_id` must be provided. Co-Authored-By: Claude Opus 4.6 --- internal/mcp/tools.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/mcp/tools.go b/internal/mcp/tools.go index f26640f..7caaf83 100644 --- a/internal/mcp/tools.go +++ b/internal/mcp/tools.go @@ -56,7 +56,7 @@ func (tr *ToolRegistrar) RegisterAll(s *server.MCPServer) { func (tr *ToolRegistrar) sendMessageTool() mcp.Tool { return mcp.NewTool("send_message", mcp.WithDescription("Send a direct message to another agent or to a channel"), - mcp.WithString("to", mcp.Description("Name of the recipient agent"), mcp.Required()), + mcp.WithString("to", mcp.Description("Name of the recipient agent (required for DMs, omit for channel messages)")), mcp.WithString("body", mcp.Description("Message body text"), mcp.Required()), mcp.WithString("subject", mcp.Description("Conversation subject (optional)")), mcp.WithNumber("priority", mcp.Description("Message priority (1-10, default 5)"), mcp.Min(1), mcp.Max(10)), @@ -151,9 +151,6 @@ func (tr *ToolRegistrar) handleSendMessage(ctx context.Context, req mcp.CallTool priority := req.GetInt("priority", 5) metadataStr := req.GetString("metadata", "") - if to == "" { - return mcp.NewToolResultError("'to' parameter is required"), nil - } if body == "" { return mcp.NewToolResultError("'body' parameter is required"), nil }