list_music
Browse available background music tracks with names and durations for video creation. Use this tool to find and select music for your shorts projects.
Instructions
List available background music tracks with names and durations. Use the exact musicName when creating shorts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number | |
| limit | No | Items per page (1-100) |
Implementation Reference
- src/tools/list-music.js:14-21 (handler)The handler function that executes the list_music tool logic.
async (params) => { try { const result = await client.listMusic(params); return { content: [{ type: 'text', text: formatPaginatedAssets(result, 'music', 'Background Music') }] }; } catch (error) { return { content: [{ type: 'text', text: formatError(error) }], isError: true }; } } - src/tools/list-music.js:4-7 (schema)Input validation schema for the list_music 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(), }; - src/tools/list-music.js:9-23 (registration)Tool registration for 'list_music'.
export function registerListMusic(server, client) { server.tool( 'list_music', 'List available background music tracks with names and durations. Use the exact musicName when creating shorts.', schema, async (params) => { try { const result = await client.listMusic(params); return { content: [{ type: 'text', text: formatPaginatedAssets(result, 'music', 'Background Music') }] }; } catch (error) { return { content: [{ type: 'text', text: formatError(error) }], isError: true }; } } ); }