Skip to main content
Glama

render_project

Render a REAPER project to an audio file in WAV, FLAC, MP3, or OGG format with configurable sample rate, bit depth, and channel count.

Instructions

Render the entire project to a file. format: wav, flac, mp3 (requires LAME), ogg. sample_rate: e.g. 44100, 48000, 96000. bit_depth: 16, 24, or 32 (WAV only; ignored for mp3/ogg/flac). channels: 1 (mono) or 2 (stereo).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_pathYes
formatNowav
sample_rateNo
bit_depthNo
channelsNo

Implementation Reference

  • The render_project function is the main tool handler. It sets render settings via _set_render_settings, executes REAPER's render command (Main_OnCommand 41824), checks if the output file exists, and returns success/failure with metadata.
    def render_project(
        output_path: str,
        format: str = "wav",
        sample_rate: int = 48000,
        bit_depth: int = 24,
        channels: int = 2,
    ) -> dict:
        """
        Render the entire project to a file.
        format: wav, flac, mp3 (requires LAME), ogg.
        sample_rate: e.g. 44100, 48000, 96000.
        bit_depth: 16, 24, or 32 (WAV only; ignored for mp3/ogg/flac).
        channels: 1 (mono) or 2 (stereo).
        """
        try:
            output_path = str(Path(output_path).expanduser().resolve())
            os.makedirs(os.path.dirname(output_path), exist_ok=True)
            _set_render_settings(output_path, format, sample_rate, bit_depth, channels, bounds=0)
            RPR.Main_OnCommand(41824, 0)  # File: Render project to disk (no dialog)
            if not os.path.exists(output_path):
                return {"success": False, "error": "Render command completed but output file not found"}
            return {
                "success": True,
                "output_path": output_path,
                "format": format,
                "sample_rate": sample_rate,
                "bit_depth": bit_depth,
                "channels": channels,
                "file_size_bytes": os.path.getsize(output_path),
            }
        except Exception as e:
            logger.error(f"render_project failed: {e}")
            return {"success": False, "error": str(e)}
  • The function signature and docstring define the input schema for render_project: output_path (str, required), format (str, default wav), sample_rate (int, default 48000), bit_depth (int, default 24), channels (int, default 2).
    def render_project(
        output_path: str,
        format: str = "wav",
        sample_rate: int = 48000,
        bit_depth: int = 24,
        channels: int = 2,
    ) -> dict:
        """
        Render the entire project to a file.
        format: wav, flac, mp3 (requires LAME), ogg.
        sample_rate: e.g. 44100, 48000, 96000.
        bit_depth: 16, 24, or 32 (WAV only; ignored for mp3/ogg/flac).
        channels: 1 (mono) or 2 (stereo).
  • The render_project function is registered as an MCP tool via the @mcp.tool() decorator inside register_tools(mcp). render_tools.register_tools is imported in server.py and called with the mcp instance.
    def register_tools(mcp):
    
        @mcp.tool()
  • _set_render_settings is a helper function called by render_project. It uses REAPER's API (GetSetProjectInfo_String, GetSetProjectInfo) to configure render output path, format, bit depth, sample rate, channels, and bounds flags.
    def _set_render_settings(
        output_path: str,
        format: str,
        sample_rate: int,
        bit_depth: int,
        channels: int,
        bounds: int,
    ) -> None:
        """Configure REAPER's render settings. bounds: 0=entire project, 1=time selection."""
        fmt_code = FORMAT_CODES.get(format.lower(), 0)
        bdepth_code = BIT_DEPTH_CODES.get(bit_depth, 2)
        RPR.GetSetProjectInfo_String(0, "RENDER_FILE", output_path, True)
        RPR.GetSetProjectInfo(0, "RENDER_FORMAT", fmt_code, True)
        RPR.GetSetProjectInfo(0, "RENDER_FORMAT2", bdepth_code, True)
        RPR.GetSetProjectInfo(0, "RENDER_SRATE", float(sample_rate), True)
        RPR.GetSetProjectInfo(0, "RENDER_CHANNELS", float(channels), True)
        RPR.GetSetProjectInfo(0, "RENDER_BOUNDSFLAG", float(bounds), True)
  • The render_tools module is imported into server.py and its register_tools function is called to register the render_project tool on the FastMCP instance.
    from reaper_mcp.render_tools import register_tools as _reg_render
    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)
Behavior3/5

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

No annotations provided, so description carries burden. It explains parameter constraints (e.g., LAME for mp3, bit_depth ignored) but does not disclose destructive behavior, overwriting, or blocking. Partial but not complete.

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

Conciseness4/5

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

Concise with a clear purpose sentence followed by parameter lines. Each line adds value. Could be more structured but is efficient and front-loaded.

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 5 parameters, no output schema, and no annotations, the description covers parameter constraints but misses output details (file creation, overwrite behavior, return value). Slightly incomplete for a complex tool.

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?

The description adds significant meaning beyond the schema: allowed formats, sample rate examples, bit_depth constraints per format, channels. Only output_path is not described, which is obvious but still a minor gap. Schema coverage 0% so description compensates well.

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 it renders the entire project to a file, using a specific verb and resource. It distinguishes from sibling tools like render_stems and render_time_selection by specifying 'entire project'.

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 implies when to use (for entire project) but does not explicitly state when not to use or mention alternatives like render_stems. No guidance on prerequisites or conditions.

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