Skip to main content
Glama

stop_transport

Stop ongoing audio playback or recording in REAPER projects.

Instructions

Stop playback or recording.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The stop_transport handler function that uses RPR.Main_OnCommand(1016, 0) to stop playback or recording, returning success/failure response.
    def stop_transport() -> dict:
        """Stop playback or recording."""
        try:
            RPR.Main_OnCommand(1016, 0)  # Transport: Stop
            return {"success": True, "message": "Transport stopped"}
        except Exception as e:
            return {"success": False, "error": str(e)}
  • The @mcp.tool() decorator and function signature define the schema - no parameters, returns dict with success/message or success/error.
    @mcp.tool()
    def stop_transport() -> dict:
        """Stop playback or recording."""
        try:
            RPR.Main_OnCommand(1016, 0)  # Transport: Stop
            return {"success": True, "message": "Transport stopped"}
        except Exception as e:
            return {"success": False, "error": str(e)}
  • The audio_tools module (containing stop_transport) is imported from reaper_mcp.audio_tools as _reg_audio and called with mcp at line 24.
    from reaper_mcp.audio_tools import register_tools as _reg_audio
  • The register_tools function defines stop_transport via the @mcp.tool() decorator pattern, registering it as an MCP tool.
    def register_tools(mcp):
    
        @mcp.tool()
        def import_audio_file(file_path: str, track_index: int, position: float = 0.0) -> dict:
            """
            Import an audio file onto a track at the given position (seconds).
            Supports all formats REAPER can read: wav, aiff, mp3, flac, ogg, etc.
            """
            try:
                if not os.path.exists(file_path):
                    return {"success": False, "error": f"File not found: {file_path}"}
                project = get_project()
                track = project.tracks[track_index]
                # Select only this track, set cursor, then insert media at cursor
                RPR.SetOnlyTrackSelected(track.id)
                project.cursor_position = position
                RPR.InsertMedia(file_path, 0)
                # Retrieve the item that was just created (last item on the track)
                track_refreshed = project.tracks[track_index]
                if track_refreshed.n_items == 0:
                    return {"success": False, "error": "Insert succeeded but no item found on track"}
                item = track_refreshed.items[track_refreshed.n_items - 1]
                return {
                    "success": True,
                    "track_index": track_index,
                    "item_index": track_refreshed.n_items - 1,
                    "position": item.position,
                    "length": item.length,
                    "file_path": file_path,
                }
            except Exception as e:
                logger.error(f"import_audio_file failed: {e}")
                return {"success": False, "error": str(e)}
    
        @mcp.tool()
        def start_recording(track_index: int) -> dict:
            """Arm a track and start recording. Call stop_transport when done."""
            try:
                project = get_project()
                track = project.tracks[track_index]
                track.armed = True
                RPR.Main_OnCommand(1013, 0)  # Transport: Record
                return {
                    "success": True,
                    "track_index": track_index,
                    "message": "Recording started. Call stop_transport to stop.",
                }
            except Exception as e:
                return {"success": False, "error": str(e)}
    
        @mcp.tool()
        def stop_transport() -> dict:
            """Stop playback or recording."""
            try:
                RPR.Main_OnCommand(1016, 0)  # Transport: Stop
                return {"success": True, "message": "Transport stopped"}
            except Exception as e:
                return {"success": False, "error": str(e)}
Behavior2/5

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

No annotations provided, so the description must carry the burden. It states the action but does not disclose idempotency, what happens if nothing is playing/recording, or whether it stops both simultaneously.

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?

One short sentence, no wasted words, and the purpose is immediately clear.

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?

Adequate for a simple tool, but lacks detail on edge cases (e.g., calling when idle) and no output schema to clarify return behavior.

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?

No parameters exist, and schema coverage is 100%. With zero parameters, baseline is 4, and description adds no additional param info as none is needed.

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 'Stop playback or recording.' uses a specific verb and resource, clearly distinguishing it from sibling tools like play_project and start_recording.

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?

No explicit guidance on when to use or not use this tool, but the context and name imply its usage for stopping ongoing playback or recording. Lacks explicit alternatives or exclusions.

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