swit-workspace-list
Get a paginated list of workspaces from Swit, filterable by name, to view and manage your collaboration spaces.
Instructions
Retrieve list of workspaces
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "swit-workspace-list"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | ||
| limit | No | ||
| name | No |
Implementation Reference
- src/handlers/core.handlers.ts:11-14 (handler)The handler function for 'swit-workspace-list'. Validates args via WorkspaceListArgsSchema and delegates to SwitClient.listWorkspaces().
export const handleWorkspaceList = async (switClient: SwitClient, args: any) => { const validatedArgs = WorkspaceListArgsSchema.parse(args); return await switClient.listWorkspaces(validatedArgs); }; - src/schemas.ts:10-14 (schema)Input schema (Zod) for workspace list arguments, accepting optional offset, limit, and name fields.
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 with name 'swit-workspace-list', description, and inputSchema derived from WorkspaceListArgsSchema.
{ name: 'swit-workspace-list', description: 'Retrieve list of workspaces', inputSchema: zodToJsonSchema(WorkspaceListArgsSchema), }, - src/handlers/core.handlers.ts:41-48 (registration)Handler mapping: maps tool name 'swit-workspace-list' to handleWorkspaceList function, merged into toolHandlers in index.ts on line 109.
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:52-55 (helper)SwitClient.listWorkspaces() — makes the actual HTTP GET request to /api/workspace.list with the validated args.
async listWorkspaces(args: WorkspaceListArgs): Promise<WorkspaceListResponse> { const response = await this.client.get('/api/workspace.list', { params: args }); return response.data; }