swit-channel-list
Retrieve a filtered list of channels from Swit workspaces by specifying workspace ID, channel type, activity, disclosure, and name. Integrate with Swit MCP Server for efficient channel management.
Instructions
Retrieve list of channels
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activity | No | ||
| disclosure | No | ||
| limit | No | ||
| name | No | ||
| offset | No | ||
| type | No | ||
| workspace_id | Yes |
Implementation Reference
- src/handlers/core.handlers.ts:16-19 (handler)The main handler function for the 'swit-channel-list' tool. It validates the input arguments using ChannelListArgsSchema and calls SwitClient.listChannels to execute the logic.export const handleChannelList = async (switClient: SwitClient, args: any) => { const validatedArgs = ChannelListArgsSchema.parse(args); return await switClient.listChannels(validatedArgs); };
- src/schemas.ts:35-43 (schema)Zod schema defining the input arguments for the 'swit-channel-list' tool.export const ChannelListArgsSchema = z.object({ workspace_id: z.string(), offset: z.string().optional(), limit: z.number().min(1).max(100).optional(), type: z.string().optional(), activity: z.string().optional(), disclosure: z.string().optional(), name: z.string().optional(), });
- src/tools/core.tools.ts:17-21 (registration)Tool specification registration including name, description, and input schema for listTools request.{ name: 'swit-channel-list', description: 'Retrieve list of channels', inputSchema: zodToJsonSchema(ChannelListArgsSchema), },
- src/handlers/core.handlers.ts:41-48 (registration)Factory function that registers the handler functions for core tools, including 'swit-channel-list', used in main server setup.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/swit-client.ts:57-60 (helper)Supporting utility in SwitClient that makes the actual API request to retrieve the list of channels.async listChannels(args: ChannelListArgs): Promise<ChannelListResponse> { const response = await this.client.get('/api/channel.list', { params: args }); return response.data; }