Skip to main content
Glama
timjrobinson

Freesound MCP Server

by timjrobinson

get_similar_sounds

Find audio samples similar to a specific sound from Freesound.org by providing its ID, with options to filter by content descriptors and paginate results.

Instructions

Find sounds similar to a given sound

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sound_idYesThe ID of the sound to find similar sounds for
descriptors_filterNoFilter similar sounds by content descriptors
pageNoPage number (default: 1)
page_sizeNoNumber of results per page (default: 15)

Implementation Reference

  • src/index.ts:106-131 (registration)
    Tool registration in the list of tools, including name, description, and input schema definition
    {
      name: "get_similar_sounds",
      description: "Find sounds similar to a given sound",
      inputSchema: {
        type: "object",
        properties: {
          sound_id: {
            type: "number",
            description: "The ID of the sound to find similar sounds for",
          },
          descriptors_filter: {
            type: "string",
            description: "Filter similar sounds by content descriptors",
          },
          page: {
            type: "number",
            description: "Page number (default: 1)",
          },
          page_size: {
            type: "number",
            description: "Number of results per page (default: 15)",
          },
        },
        required: ["sound_id"],
      },
    },
  • MCP CallToolRequest handler for get_similar_sounds, which delegates to FreesoundClient and returns JSON response
    case "get_similar_sounds": {
      const similar = await freesoundClient.getSimilarSounds(
        args.sound_id as number,
        {
          descriptors_filter: args.descriptors_filter as string | undefined,
          page: args.page as number | undefined,
          page_size: args.page_size as number | undefined,
        }
      );
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(similar, null, 2),
          },
        ],
      };
    }
  • Core implementation of getSimilarSounds in FreesoundClient, making API call to Freesound similar sounds endpoint
    async getSimilarSounds(
      soundId: number,
      params?: SimilarSoundsParams
    ): Promise<PaginatedResults<Sound>> {
      const response = await this.axiosInstance.get(
        `/sounds/${soundId}/similar/`,
        {
          params: {
            descriptors_filter: params?.descriptors_filter,
            page: params?.page || 1,
            page_size: params?.page_size || 15,
          },
        }
      );
      return response.data;
    }
  • TypeScript interface defining parameters for getSimilarSounds
    export interface SimilarSoundsParams extends PaginationParams {
      descriptors_filter?: string;
    }

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