Skip to main content
Glama

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
NameRequiredDescriptionDefault
assetsNo
body_typeNoplain
contentYes
external_asset_typeNo
message_idYes

Implementation Reference

  • 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); };
  • 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), });
  • 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), },
  • 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(), });
  • 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; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TykanN/swit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server