get_pack_sounds
Retrieve audio samples from a specific Freesound pack by providing the pack ID. Access multiple sounds from organized collections with pagination support for browsing large packs.
Instructions
Get sounds from a specific pack
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pack_id | Yes | The ID of the pack | |
| page | No | Page number (default: 1) | |
| page_size | No | Number of results per page (default: 15) |
Implementation Reference
- src/index.ts:323-339 (handler)MCP CallTool handler for 'get_pack_sounds': extracts arguments, calls FreesoundClient.getPackSounds, and returns paginated results as JSON text.case "get_pack_sounds": { const sounds = await freesoundClient.getPackSounds( args.pack_id as number, { page: args.page as number | undefined, page_size: args.page_size as number | undefined, } ); return { content: [ { type: "text", text: JSON.stringify(sounds, null, 2), }, ], }; }
- src/index.ts:182-203 (registration)Tool registration in ListTools response, including name, description, and input schema.{ name: "get_pack_sounds", description: "Get sounds from a specific pack", inputSchema: { type: "object", properties: { pack_id: { type: "number", description: "The ID of the pack", }, page: { type: "number", description: "Page number (default: 1)", }, page_size: { type: "number", description: "Number of results per page (default: 15)", }, }, required: ["pack_id"], }, },
- src/freesound-client.ts:231-242 (handler)Core handler logic: Freesound API call to retrieve sounds from a pack, with pagination support.async getPackSounds( packId: number, params?: PaginationParams ): Promise<PaginatedResults<Sound>> { const response = await this.axiosInstance.get(`/packs/${packId}/sounds/`, { params: { page: params?.page || 1, page_size: params?.page_size || 15, }, }); return response.data; }
- src/freesound-client.ts:12-15 (schema)Type definition for pagination parameters used in getPackSounds input.export interface PaginationParams { page?: number; page_size?: number; }
- src/freesound-client.ts:104-109 (schema)Generic type for paginated API responses, used as return type for getPackSounds.export interface PaginatedResults<T> { count: number; next: string | null; previous: string | null; results: T[]; }