Skip to main content
Glama

normalize_project

Measure a project's integrated loudness and automatically adjust the master volume to hit a specified LUFS target, such as -14 for streaming or -16 for podcasts.

Instructions

Measure the project's integrated loudness, then adjust the master volume so the output hits the target LUFS level. Common targets: -14 LUFS (streaming), -16 LUFS (podcasts), -23 LUFS (broadcast).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
target_lufsNo

Implementation Reference

  • The normalize_project tool handler: renders project to temp WAV, measures LUFS via pyloudnorm, computes gain adjustment, and sets master volume to hit target LUFS.
    @mcp.tool()
    def normalize_project(target_lufs: float = -14.0) -> dict:
        """
        Measure the project's integrated loudness, then adjust the master volume
        so the output hits the target LUFS level.
        Common targets: -14 LUFS (streaming), -16 LUFS (podcasts), -23 LUFS (broadcast).
        """
        try:
            import soundfile as sf
            import pyloudnorm as pyln
            from reaper_mcp.render_tools import render_to_temp_file
    
            tmp = render_to_temp_file()
            try:
                data, rate = sf.read(tmp)
                meter = pyln.Meter(rate)
                current_lufs = meter.integrated_loudness(data)
            finally:
                if os.path.exists(tmp):
                    os.unlink(tmp)
    
            if current_lufs == float("-inf"):
                return {"success": False, "error": "Project appears to be silent"}
    
            gain_db = target_lufs - current_lufs
            project = get_project()
            master = project.master_track
            new_vol_db = master.volume + gain_db
            master.volume = new_vol_db
    
            return {
                "success": True,
                "original_lufs": round(current_lufs, 1),
                "target_lufs": target_lufs,
                "gain_applied_db": round(gain_db, 1),
                "new_master_volume_db": round(new_vol_db, 1),
            }
        except Exception as e:
            return {"success": False, "error": str(e)}
  • The register_tools function in mastering_tools.py, which is called from server.py to register the normalize_project tool via @mcp.tool() decorator.
    def register_tools(mcp):
  • Import and invocation of mastering_tools.register_tools in server.py, which registers normalize_project as an MCP tool.
    from reaper_mcp.mastering_tools import register_tools as _reg_mastering
    from reaper_mcp.analysis_tools import register_tools as _reg_analysis
    
    _reg_project(mcp)
    _reg_track(mcp)
    _reg_midi(mcp)
    _reg_fx(mcp)
    _reg_audio(mcp)
    _reg_mixing(mcp)
    _reg_render(mcp)
    _reg_mastering(mcp)
    _reg_analysis(mcp)
  • render_to_temp_file helper: renders the current project to a temporary WAV file for loudness analysis by normalize_project.
    def render_to_temp_file(sample_rate: int = 48000) -> str:
        """
        Render the current project to a temporary WAV file and return its path.
        Used by analysis and mastering tools. Caller is responsible for deleting the file.
        """
        import tempfile
        tmp = tempfile.mktemp(suffix=".wav")
        _set_render_settings(tmp, "wav", sample_rate, 24, 2, bounds=0)
        RPR.Main_OnCommand(41824, 0)
        return tmp
  • get_project helper used by normalize_project to obtain the REAPER project reference for adjusting master volume.
    def get_project() -> reapy.Project:
        ensure_connected()
        return reapy.Project()
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the basic operation (measure then adjust) but lacks details on destructiveness, reversibility, automation handling, or processing time. This is adequate but not comprehensive.

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?

Three sentences, each adding value. The first sentence states the action, the second explains the process, the third gives examples. No unnecessary words, well front-loaded.

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

Completeness4/5

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

For a simple tool with one parameter and no output schema, the description covers the essential functionality. It could mention whether the adjustment is destructive or if there is feedback, but it is mostly complete for its complexity level.

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 coverage is 0% so description adds meaning. It provides context for target_lufs with common values (-14, -16, -23) and their typical use cases (streaming, podcasts, broadcast), which helps the agent understand the parameter beyond the default and title.

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 tool measures integrated loudness and adjusts master volume to hit a target LUFS level, with examples of common targets. This distinguishes it from sibling tools like analyze_loudness (analysis only) and set_master_volume (direct setting without normalization).

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

Usage Guidelines3/5

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

The description gives common target values but does not explicitly state when to use this tool versus alternatives like apply_limiter or analyze_loudness, nor does it mention any prerequisites or when not to use it. Usage is implied but not clearly delineated.

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/bonfire-audio/reaper-mcp'

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