list_sessions
Retrieve and manage active sessions with pagination controls for admin oversight. Filter by wallet ID and control result display using limit and offset parameters.
Instructions
List active sessions with pagination. Admin operation requiring master auth.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet_id | No | Filter by wallet ID | |
| limit | No | Max items to return (default: 50) | |
| offset | No | Number of items to skip (default: 0) |
Implementation Reference
- The handler function that executes the `list_sessions` tool logic by calling the API client with provided query parameters.
async (args) => { const params = new URLSearchParams(); if (args.wallet_id) params.set('walletId', args.wallet_id); if (args.limit !== undefined) params.set('limit', String(args.limit)); if (args.offset !== undefined) params.set('offset', String(args.offset)); const qs = params.toString(); const result = await apiClient.get('/v1/sessions' + (qs ? '?' + qs : '')); return toToolResult(result); }, ); - packages/mcp/src/tools/list-sessions.ts:10-29 (registration)The registration function that defines the `list_sessions` tool on the McpServer instance.
export function registerListSessions(server: McpServer, apiClient: ApiClient): void { server.tool( 'list_sessions', 'List active sessions with pagination. Admin operation requiring master auth.', { wallet_id: z.string().optional().describe('Filter by wallet ID'), limit: z.number().int().min(1).max(200).optional().describe('Max items to return (default: 50)'), offset: z.number().int().min(0).optional().describe('Number of items to skip (default: 0)'), }, async (args) => { const params = new URLSearchParams(); if (args.wallet_id) params.set('walletId', args.wallet_id); if (args.limit !== undefined) params.set('limit', String(args.limit)); if (args.offset !== undefined) params.set('offset', String(args.offset)); const qs = params.toString(); const result = await apiClient.get('/v1/sessions' + (qs ? '?' + qs : '')); return toToolResult(result); }, ); }