Skip to main content
Glama
timjrobinson

Freesound MCP Server

by timjrobinson

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
NameRequiredDescriptionDefault
pack_idYesThe ID of the pack
pageNoPage number (default: 1)
page_sizeNoNumber of results per page (default: 15)

Implementation Reference

  • 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"], }, },
  • 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; }
  • Type definition for pagination parameters used in getPackSounds input.
    export interface PaginationParams { page?: number; page_size?: number; }
  • 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[]; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/timjrobinson/FreesoundMCPServer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server