swit-message-comment-list
Retrieve comments on a specific message in Swit collaboration tools to view discussions and track feedback.
Instructions
Retrieve list of comments on message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_id | Yes | ||
| offset | No | ||
| limit | No |
Implementation Reference
- src/handlers/core.handlers.ts:31-34 (handler)The primary handler function for the 'swit-message-comment-list' tool. Validates input arguments using Zod schema and delegates to SwitClient's listMessageComments method.export const handleMessageCommentList = async (switClient: SwitClient, args: any) => { const validatedArgs = MessageCommentListArgsSchema.parse(args); return await switClient.listMessageComments(validatedArgs); };
- src/schemas.ts:95-99 (schema)Zod schema defining the input arguments for the tool: requires message_id, optional offset and limit for pagination.export const MessageCommentListArgsSchema = z.object({ message_id: z.string(), offset: z.string().optional(), limit: z.number().min(1).max(100).optional(), });
- src/handlers/core.handlers.ts:41-48 (registration)Registration of tool handlers, mapping 'swit-message-comment-list' to its handler function.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/index.ts:109-109 (registration)Final registration of all tool handlers into the MCP server's toolHandlers map after initialization.toolHandlers = { ...oauthHandlers(oauthWebServer), ...coreHandlers(switClient) };
- src/tools/core.tools.ts:32-36 (schema)Tool metadata definition including name, description, and input JSON schema for listTools endpoint.{ name: 'swit-message-comment-list', description: 'Retrieve list of comments on message', inputSchema: zodToJsonSchema(MessageCommentListArgsSchema), },
- src/swit-client.ts:67-70 (helper)Underlying SwitClient method that performs the actual API call to retrieve message comments.async listMessageComments(args: MessageCommentListArgs): Promise<MessageCommentListResponse> { const response = await this.client.get('/api/message.comment.list', { params: args }); return response.data; }