Skip to main content
Glama

add_pan_automation

Add a pan automation point on a track at a specified position, with pan values from -1.0 (full left) to 1.0 (full right). The pan envelope must be visible.

Instructions

Add a pan automation point on a track. The pan envelope must be visible in REAPER. pan: -1.0 (full left) to 1.0 (full right).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
track_indexYes
positionYes
panYes

Implementation Reference

  • The actual handler function that adds a pan automation point on a track. It gets the project, finds the track by index, retrieves the Pan envelope via RPR.GetTrackEnvelopeByName, inserts a point with RPR.InsertEnvelopePoint, sorts points, and returns success/failure.
    @mcp.tool()
    def add_pan_automation(track_index: int, position: float, pan: float) -> dict:
        """
        Add a pan automation point on a track.
        The pan envelope must be visible in REAPER.
        pan: -1.0 (full left) to 1.0 (full right).
        """
        try:
            project = get_project()
            track = project.tracks[track_index]
            envelope = RPR.GetTrackEnvelopeByName(track.id, "Pan")
            if not envelope:
                return {
                    "success": False,
                    "error": (
                        "Pan envelope not found. Show it first: right-click the track "
                        "in REAPER and choose 'Show envelope for track pan'."
                    ),
                }
            RPR.InsertEnvelopePoint(envelope, position, pan, 0, 0, False, True)
            RPR.Envelope_SortPoints(envelope)
            return {"success": True, "track_index": track_index, "position": position, "pan": pan}
        except Exception as e:
            return {"success": False, "error": str(e)}
  • Registration entry point: the server.py imports register_tools from mixing_tools (aliased as _reg_mixing) and calls it with the mcp instance, which registers add_pan_automation via the @mcp.tool() decorator.
    # Import each tool module's register_tools function and call it with the mcp instance.
    # The imports must happen after mcp is created to avoid circular dependencies.
    from reaper_mcp.project_tools import register_tools as _reg_project
    from reaper_mcp.track_tools import register_tools as _reg_track
    from reaper_mcp.midi_tools import register_tools as _reg_midi
    from reaper_mcp.fx_tools import register_tools as _reg_fx
    from reaper_mcp.audio_tools import register_tools as _reg_audio
    from reaper_mcp.mixing_tools import register_tools as _reg_mixing
    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)
  • Helper function that ensures a connection to REAPER and returns the current project object, used by the handler to access tracks.
    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?

No annotations are provided, so the description must carry the full burden. It reveals the pan range and a precondition, but does not describe error handling (e.g., if envelope not visible), automation mode requirements, or side effects on playback.

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. No fluff, front-loaded with purpose. Efficient and clear within its scope.

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 complexity (3 required params, no output schema), the description covers the core action and pan range but misses explanations for track_index and position. It does not specify return values or error conditions, leaving gaps for an agent.

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

Parameters2/5

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

Schema coverage is 0%, so the description must compensate. Only the pan parameter's range is explained; track_index and position are left undefined. This leaves significant ambiguity for correct parameter usage.

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 adds a pan automation point on a track, with a specific verb and resource. It distinguishes from siblings like add_volume_automation and set_track_pan by focusing on automation points.

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?

It mentions a prerequisite (envelope must be visible) but does not explicitly guide when to use this tool versus alternatives like add_volume_automation or set_track_pan. Usage context is implied but not fully articulated.

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