list_requests
Retrieve and manage short video creation requests with filtering, pagination, and sorting options for tracking progress.
Instructions
List all short creation requests with optional status filtering, pagination, and sorting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number | |
| limit | No | Items per page (1-100) | |
| status | No | Filter by status | |
| sortBy | No | Sort field | createdAt |
| sortOrder | No | Sort direction | desc |
Implementation Reference
- src/tools/list-requests.js:17-24 (handler)The handler function for the list_requests tool, which calls the client and formats the response.
async (params) => { try { const result = await client.listRequests(params); return { content: [{ type: 'text', text: formatListRequestsResponse(result) }] }; } catch (error) { return { content: [{ type: 'text', text: formatError(error) }], isError: true }; } } - src/tools/list-requests.js:12-26 (registration)The registration function for the list_requests tool.
export function registerListRequests(server, client) { server.tool( 'list_requests', 'List all short creation requests with optional status filtering, pagination, and sorting.', schema, async (params) => { try { const result = await client.listRequests(params); return { content: [{ type: 'text', text: formatListRequestsResponse(result) }] }; } catch (error) { return { content: [{ type: 'text', text: formatError(error) }], isError: true }; } } ); } - src/tools/list-requests.js:4-10 (schema)Input validation schema for the list_requests tool.
const schema = { page: z.number().min(1).default(1).describe('Page number').optional(), limit: z.number().min(1).max(100).default(20).describe('Items per page (1-100)').optional(), status: z.enum(['queued', 'processing', 'completed', 'failed', 'cancelled']).describe('Filter by status').optional(), sortBy: z.enum(['createdAt', 'updatedAt']).default('createdAt').describe('Sort field').optional(), sortOrder: z.enum(['asc', 'desc']).default('desc').describe('Sort direction').optional(), }; - src/api/client.js:115-117 (helper)The underlying API client method that performs the network request for listRequests.
async listRequests(query) { return this._request('GET', '/shorts', { query }); }