swit-message-comment-create
Add comments to messages in Swit workspaces, supporting plain text or markdown formatting and optional assets, to enhance collaboration and communication within channels.
Instructions
Create comment on message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assets | No | ||
| body_type | No | plain | |
| content | Yes | ||
| external_asset_type | No | ||
| message_id | Yes |
Implementation Reference
- src/handlers/core.handlers.ts:26-29 (handler)The core handler function for the 'swit-message-comment-create' tool. It validates the input arguments using MessageCommentCreateArgsSchema and delegates to SwitClient.createMessageComment.export const handleMessageCommentCreate = async (switClient: SwitClient, args: any) => { const validatedArgs = MessageCommentCreateArgsSchema.parse(args); return await switClient.createMessageComment(validatedArgs); };
- src/handlers/core.handlers.ts:41-48 (registration)Factory function that creates the handlers object mapping tool names to their handler functions, including 'swit-message-comment-create'.export const coreHandlers = (switClient: SwitClient) => ({ 'swit-workspace-list': (args: any) => handleWorkspaceList(switClient, args), 'swit-channel-list': (args: any) => handleChannelList(switClient, args), 'swit-message-create': (args: any) => handleMessageCreate(switClient, args), 'swit-message-comment-create': (args: any) => handleMessageCommentCreate(switClient, args), 'swit-message-comment-list': (args: any) => handleMessageCommentList(switClient, args), 'swit-project-list': (args: any) => handleProjectList(switClient, args), });
- src/tools/core.tools.ts:27-31 (schema)Tool definition including name, description, and input schema (converted from Zod schema) for MCP tool listing.{ name: 'swit-message-comment-create', description: 'Create comment on message', inputSchema: zodToJsonSchema(MessageCommentCreateArgsSchema), },
- src/schemas.ts:101-107 (schema)Zod schema defining the input arguments for creating a message comment, used for validation in the handler and schema conversion.export const MessageCommentCreateArgsSchema = z.object({ message_id: z.string(), content: z.string(), body_type: z.enum(['plain', 'markdown']).default('plain').optional(), assets: z.record(z.any()).optional(), external_asset_type: z.string().optional(), });
- src/swit-client.ts:72-77 (helper)SwitClient method that performs the actual HTTP POST request to Swit API endpoint /api/message.comment.create.async createMessageComment( args: MessageCommentCreateArgs ): Promise<MessageCommentCreateResponse> { const response = await this.client.post('/api/message.comment.create', args); return response.data; }