swit-workspace-list
Retrieve a list of workspaces with pagination and filtering options such as name, offset, and limit, integrating with Swit collaboration tools via the MCP server.
Instructions
Retrieve list of workspaces
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| name | No | ||
| offset | No |
Implementation Reference
- src/handlers/core.handlers.ts:11-14 (handler)The main handler function for the 'swit-workspace-list' tool. It parses the input arguments using the Zod schema and calls the SwitClient's listWorkspaces method.export const handleWorkspaceList = async (switClient: SwitClient, args: any) => { const validatedArgs = WorkspaceListArgsSchema.parse(args); return await switClient.listWorkspaces(validatedArgs); };
- src/schemas.ts:10-14 (schema)Zod schema defining the input parameters for the swit-workspace-list tool, including optional offset, limit, and name filters.export const WorkspaceListArgsSchema = z.object({ offset: z.string().optional(), limit: z.number().min(1).max(100).optional(), name: z.string().optional(), });
- src/tools/core.tools.ts:12-16 (registration)Tool registration in the coreTools array, specifying the name, description, and input schema for MCP.{ name: 'swit-workspace-list', description: 'Retrieve list of workspaces', inputSchema: zodToJsonSchema(WorkspaceListArgsSchema), },
- src/handlers/core.handlers.ts:41-48 (registration)Handler registration mapping the 'swit-workspace-list' tool name to its handler function within the coreHandlers factory.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), });