Skip to main content
Glama
pixxelboy

IRCAM Amplify MCP Server

by pixxelboy

analyze_music

Extract genre, mood, tempo, key, and instruments from audio files to classify music and enhance discovery. Accepts MP3, WAV, FLAC, OGG, or M4A URLs.

Instructions

Analyze an audio file to extract genre, mood, tempo, key, and detected instruments. Accepts a public URL to an audio file (MP3, WAV, FLAC, OGG, M4A). Returns structured tags useful for music classification and discovery.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audio_urlYesPublic URL to the audio file to analyze

Implementation Reference

  • The handler function that validates the audio_url input, calls the IRCAM Music Tagger API via httpPost, handles errors, and returns the transformed MusicAnalysisResult.
    export async function handleAnalyzeMusic(
      args: Record<string, unknown>
    ): Promise<MusicAnalysisResult> {
      const audioUrl = args.audio_url as string;
    
      // Validate input
      const validation = validateAudioUrl(audioUrl);
      if (!validation.valid) {
        throw validation.error;
      }
    
      // Call IRCAM Music Tagger API
      const url = buildApiUrl(IRCAM_API_CONFIG.ENDPOINTS.MUSIC_TAGGER);
      const response = await httpPost<IrcamMusicTaggerResponse>(url, {
        url: audioUrl,
      });
    
      if (!response.ok || !response.data) {
        throw response.error || formatError('UNKNOWN_ERROR', 'Failed to analyze music');
      }
    
      // Transform and return result
      return transformMusicTaggerResponse(response.data);
    }
  • The tool definition including the inputSchema that requires a public audio_url string.
    export const analyzeMusicTool: Tool = {
      name: 'analyze_music',
      description:
        'Analyze an audio file to extract genre, mood, tempo, key, and detected instruments. ' +
        'Accepts a public URL to an audio file (MP3, WAV, FLAC, OGG, M4A). ' +
        'Returns structured tags useful for music classification and discovery.',
      inputSchema: {
        type: 'object',
        properties: {
          audio_url: {
            type: 'string',
            description: 'Public URL to the audio file to analyze',
          },
        },
        required: ['audio_url'],
      },
    };
  • src/index.ts:48-54 (registration)
    Maps the 'analyze_music' tool name to its handler function handleAnalyzeMusic for execution in the MCP server.
    const TOOL_HANDLERS: Record<string, (args: Record<string, unknown>) => Promise<unknown>> = {
      analyze_music: handleAnalyzeMusic,
      separate_stems: handleSeparateStems,
      detect_ai_music: handleDetectAiMusic,
      analyze_loudness: handleAnalyzeLoudness,
      check_job_status: handleCheckJobStatus,
    };
  • src/index.ts:37-43 (registration)
    Registers the analyzeMusicTool in the list of available tools returned by listTools.
    const TOOLS = [
      analyzeMusicTool,
      separateStemsTool,
      detectAiMusicTool,
      analyzeLoudnessTool,
      checkJobStatusTool,
    ];
  • TypeScript interface defining the output structure of the analyze_music tool.
    export interface MusicAnalysisResult {
      /** Genres détectés (ex: ["electronic", "house"]) */
      genre: string[];
      /** Ambiances/moods (ex: ["energetic", "uplifting"]) */
      mood: string[];
      /** Tempo en BPM */
      tempo: number;
      /** Tonalité (ex: "C major", "A minor") */
      key: string;
      /** Instruments détectés */
      instruments: string[];
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the input format ('public URL to an audio file') and output purpose ('structured tags'), but lacks details on error handling, rate limits, or authentication needs, leaving gaps for a tool that performs analysis.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, uses two efficient sentences without redundancy, and every part contributes essential information, making it appropriately sized and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (analysis with one parameter) and no annotations or output schema, the description is adequate but incomplete. It covers input and output purpose but lacks details on response format, limitations, or error cases, which could hinder effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the single parameter. The description adds value by specifying acceptable file formats ('MP3, WAV, FLAC, OGG, M4A') and clarifying the URL must be public, which goes beyond the schema's basic description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('analyze an audio file') and resources involved ('extract genre, mood, tempo, key, and detected instruments'), distinguishing it from siblings like analyze_loudness or detect_ai_music by specifying comprehensive music analysis rather than focused tasks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('to extract genre, mood, tempo, key, and detected instruments' for 'music classification and discovery'), but does not explicitly state when not to use it or name alternatives among siblings, such as using analyze_loudness for volume analysis instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/pixxelboy/amplify-mcp'

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