Skip to main content
Glama
timjrobinson

Freesound MCP Server

by timjrobinson

get_sound_analysis

Retrieve detailed audio analysis data for Freesound samples, including descriptors and normalized values, to understand sound characteristics and properties.

Instructions

Get audio analysis data for a specific sound

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sound_idYesThe ID of the sound
descriptorsNoComma-separated list of analysis descriptors to retrieve
normalizedNoWhether to normalize descriptor values

Implementation Reference

  • The core handler function that performs the HTTP request to the Freesound API to retrieve audio analysis data for a specific sound.
    async getSoundAnalysis( soundId: number, descriptors?: string, normalized?: boolean ): Promise<any> { const response = await this.axiosInstance.get( `/sounds/${soundId}/analysis/`, { params: { descriptors: descriptors, normalized: normalized !== undefined ? (normalized ? 1 : 0) : undefined, }, } ); return response.data; }
  • Input schema definition for the get_sound_analysis tool, including parameters and validation rules.
    name: "get_sound_analysis", description: "Get audio analysis data for a specific sound", inputSchema: { type: "object", properties: { sound_id: { type: "number", description: "The ID of the sound", }, descriptors: { type: "string", description: "Comma-separated list of analysis descriptors to retrieve", }, normalized: { type: "boolean", description: "Whether to normalize descriptor values", }, }, required: ["sound_id"], }, },
  • src/index.ts:32-206 (registration)
    Registers the get_sound_analysis tool in the MCP server's list of available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { 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"], }, }, { name: "get_sound", description: "Get detailed information about a specific sound", inputSchema: { type: "object", properties: { sound_id: { type: "number", description: "The ID of the sound", }, descriptors: { type: "string", description: "Comma-separated list of content-based descriptors to include", }, }, required: ["sound_id"], }, }, { name: "get_sound_analysis", description: "Get audio analysis data for a specific sound", inputSchema: { type: "object", properties: { sound_id: { type: "number", description: "The ID of the sound", }, descriptors: { type: "string", description: "Comma-separated list of analysis descriptors to retrieve", }, normalized: { type: "boolean", description: "Whether to normalize descriptor values", }, }, required: ["sound_id"], }, }, { 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"], }, }, { name: "get_user", description: "Get information about a Freesound user", inputSchema: { type: "object", properties: { username: { type: "string", description: "The username of the user", }, }, required: ["username"], }, }, { name: "get_user_sounds", description: "Get sounds uploaded by a specific user", inputSchema: { type: "object", properties: { username: { type: "string", description: "The username of the user", }, page: { type: "number", description: "Page number (default: 1)", }, page_size: { type: "number", description: "Number of results per page (default: 15)", }, }, required: ["username"], }, }, { name: "get_pack", description: "Get information about a sound pack", inputSchema: { type: "object", properties: { pack_id: { type: "number", description: "The ID of the pack", }, }, required: ["pack_id"], }, }, { 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"], }, }, ], }; });
  • MCP CallTool request handler that dispatches to the FreesoundClient's getSoundAnalysis method and formats the response.
    case "get_sound_analysis": { const analysis = await freesoundClient.getSoundAnalysis( args.sound_id as number, args.descriptors as string | undefined, args.normalized as boolean | undefined ); return { content: [ { type: "text", text: JSON.stringify(analysis, 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