Skip to main content
Glama
timjrobinson

Freesound MCP Server

by timjrobinson

get_sound_analysis

Retrieve audio analysis data for Freesound samples to examine acoustic properties, spectral features, and temporal characteristics for research or creative projects.

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

  • MCP tool handler for 'get_sound_analysis': extracts input arguments, calls FreesoundClient.getSoundAnalysis, and returns the analysis as formatted JSON text content.
    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), }, ], }; }
  • Input schema for the 'get_sound_analysis' tool, defining required sound_id and optional descriptors and normalized parameters.
    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:84-105 (registration)
    Registration of the 'get_sound_analysis' tool in the MCP server's tool list, including name, description, and input schema.
    { 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"], }, },
  • Core implementation in FreesoundClient: makes authenticated API request to Freesound.org for sound analysis data based on sound ID and optional descriptors/normalized params.
    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; }

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