Skip to main content
Glama
timjrobinson

Freesound MCP Server

by timjrobinson

search_sounds

Find and retrieve audio samples from Freesound using text queries, with options to filter by duration, sort by various criteria, and control pagination for precise sound discovery.

Instructions

Search for sounds on Freesound using text queries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query terms
filterNoFilter query using Solr syntax (e.g., 'duration:[1 TO 5]')
sortNoSort results by: score, duration_desc, duration_asc, created_desc, created_asc, downloads_desc, downloads_asc, rating_desc, rating_asc
pageNoPage number (default: 1)
page_sizeNoNumber of results per page (default: 15, max: 150)

Implementation Reference

  • Core handler function that executes the Freesound API search request and returns results.
    async searchSounds(params: SearchParams): Promise<SearchResults> { const response = await this.axiosInstance.get('/search/text/', { params: { query: params.query, filter: params.filter, sort: params.sort, page: params.page || 1, page_size: params.page_size || 15, group_by_pack: params.group_by_pack ? 1 : 0, }, }); return response.data; }
  • TypeScript interface defining the input parameters for the search_sounds tool.
    export interface SearchParams { query: string; filter?: string; sort?: string; page?: number; page_size?: number; group_by_pack?: boolean; }
  • TypeScript interface defining the output structure of search results.
    export interface SearchResults { count: number; next: string | null; previous: string | null; results: Sound[]; }
  • src/index.ts:35-65 (registration)
    MCP tool registration including name, description, and input schema for listTools handler.
    { name: "search_sounds", description: "Search for sounds on Freesound using text queries", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query terms", }, filter: { type: "string", description: "Filter query using Solr syntax (e.g., 'duration:[1 TO 5]')", }, sort: { type: "string", description: "Sort results by: score, duration_desc, duration_asc, created_desc, created_asc, downloads_desc, downloads_asc, rating_desc, rating_asc", enum: ["score", "duration_desc", "duration_asc", "created_desc", "created_asc", "downloads_desc", "downloads_asc", "rating_desc", "rating_asc"], }, page: { type: "number", description: "Page number (default: 1)", }, page_size: { type: "number", description: "Number of results per page (default: 15, max: 150)", }, }, required: ["query"], }, },
  • Dispatch handler in CallToolRequestSchema that invokes the searchSounds method.
    case "search_sounds": { const results = await freesoundClient.searchSounds({ query: args.query as string, filter: args.filter as string | undefined, sort: args.sort as string | undefined, page: args.page as number | undefined, page_size: args.page_size as number | undefined, }); return { content: [ { type: "text", text: JSON.stringify(results, null, 2), }, ], }; }

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