swit-channel-list
Retrieve channel lists from Swit workspaces to organize team communication. Filter by type, activity, disclosure, or name to find specific channels.
Instructions
Retrieve list of channels
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_id | Yes | ||
| offset | No | ||
| limit | No | ||
| type | No | ||
| activity | No | ||
| disclosure | No | ||
| name | No |
Implementation Reference
- src/handlers/core.handlers.ts:16-19 (handler)Main handler function for the 'swit-channel-list' MCP tool. Validates input arguments and calls SwitClient.listChannels.
export const handleChannelList = async (switClient: SwitClient, args: any) => { const validatedArgs = ChannelListArgsSchema.parse(args); return await switClient.listChannels(validatedArgs); }; - src/swit-client.ts:57-60 (helper)SwitClient method that performs the actual API call to list channels via axios GET /api/channel.list.
async listChannels(args: ChannelListArgs): Promise<ChannelListResponse> { const response = await this.client.get('/api/channel.list', { params: args }); return response.data; } - src/schemas.ts:35-43 (schema)Zod schema defining the input arguments for listing channels (workspace_id required, pagination and filters optional).
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 (schema)MCP tool metadata: name, description, and input schema (JSON schema from Zod).
{ name: 'swit-channel-list', description: 'Retrieve list of channels', inputSchema: zodToJsonSchema(ChannelListArgsSchema), }, - src/handlers/core.handlers.ts:41-48 (registration)Factory registering 'swit-channel-list' handler among core handlers, used by main server.
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), });