swit-message-comment-create
Add comments to messages in Swit workspaces to provide feedback, ask questions, or share information directly within conversations.
Instructions
Create comment on message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_id | Yes | ||
| content | Yes | ||
| body_type | No | plain | |
| assets | No | ||
| external_asset_type | No |
Implementation Reference
- src/handlers/core.handlers.ts:26-29 (handler)The main 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/schemas.ts:101-107 (schema)Zod schema defining the input arguments for creating a message comment: requires message_id and content, optional body_type, assets, external_asset_type.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/tools/core.tools.ts:27-31 (registration)Tool metadata registration including name, description, and input schema (converted to JSON schema for MCP).{ name: 'swit-message-comment-create', description: 'Create comment on message', inputSchema: zodToJsonSchema(MessageCommentCreateArgsSchema), },
- src/handlers/core.handlers.ts:45-45 (registration)Maps the tool name to its handler function within the coreHandlers factory.'swit-message-comment-create': (args: any) => handleMessageCommentCreate(switClient, args),
- src/swit-client.ts:72-77 (helper)The SwitClient method that performs the actual API call to create a message comment via POST to /api/message.comment.create.async createMessageComment( args: MessageCommentCreateArgs ): Promise<MessageCommentCreateResponse> { const response = await this.client.post('/api/message.comment.create', args); return response.data; }