get_shorts
Retrieve AI-generated short video clips from a completed request, including video URLs, titles, descriptions, viral scores, and durations sorted by popularity.
Instructions
Retrieve all generated short clips for a completed request. Returns video URLs, AI-generated titles, descriptions, viral scores, and durations sorted by viral score.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| requestId | Yes | The request ID from create_short (24-char hex) |
Implementation Reference
- src/tools/get-shorts.js:13-20 (handler)The handler function for the get_shorts tool, which calls the client's getShorts method and formats the result.
async ({ requestId }) => { try { const result = await client.getShorts(requestId); return { content: [{ type: 'text', text: formatShortsResponse(result) }] }; } catch (error) { return { content: [{ type: 'text', text: formatError(error) }], isError: true }; } } - src/tools/get-shorts.js:8-22 (registration)Registration function for the get_shorts tool.
export function registerGetShorts(server, client) { server.tool( 'get_shorts', 'Retrieve all generated short clips for a completed request. Returns video URLs, AI-generated titles, descriptions, viral scores, and durations sorted by viral score.', schema, async ({ requestId }) => { try { const result = await client.getShorts(requestId); return { content: [{ type: 'text', text: formatShortsResponse(result) }] }; } catch (error) { return { content: [{ type: 'text', text: formatError(error) }], isError: true }; } } ); } - src/tools/get-shorts.js:4-6 (schema)Input validation schema for the get_shorts tool using Zod.
const schema = { requestId: z.string().regex(/^[0-9a-fA-F]{24}$/).describe('The request ID from create_short (24-char hex)'), }; - src/api/client.js:110-112 (helper)The client-side method that performs the API call to retrieve shorts.
async getShorts(requestId) { return this._request('GET', `/shorts/${requestId}`); }