Skip to main content
Glama

delete_track

Delete a track from a REAPER project by specifying its index number. Remove unwanted tracks to simplify your project structure.

Instructions

Delete a track by its index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
track_indexYes

Implementation Reference

  • The delete_track function that executes the tool logic. It gets the project, finds the track by index, and calls RPR.DeleteTrack(track.id) to delete it.
    @mcp.tool()
    def delete_track(track_index: int) -> dict:
        """Delete a track by its index."""
        try:
            project = get_project()
            track = project.tracks[track_index]
            RPR.DeleteTrack(track.id)
            return {"success": True, "deleted_index": track_index}
        except Exception as e:
            return {"success": False, "error": str(e)}
  • The delete_track function signature takes a single int parameter 'track_index' and returns a dict — this defines the input schema for the MCP tool.
    def delete_track(track_index: int) -> dict:
  • The @mcp.tool() decorator on line 40 registers delete_track as an MCP tool. The register_tools function is called from server.py where the mcp instance is wired up.
    def register_tools(mcp):
    
        @mcp.tool()
        def create_track(name: str, track_type: str = "audio") -> dict:
            """
            Create a new track at the end of the project.
            track_type: audio, midi, instrument, folder
            """
            try:
                project = get_project()
                idx = project.n_tracks
                project.add_track(idx, name)
                track = project.tracks[idx]
    
                if track_type in ("midi", "instrument"):
                    RPR.SetMediaTrackInfo_Value(track.id, "I_RECINPUT", 4096)  # All MIDI inputs
                elif track_type == "folder":
                    RPR.SetMediaTrackInfo_Value(track.id, "I_FOLDERDEPTH", 1)
    
                return {
                    "success": True,
                    "track_index": idx,
                    "name": track.name,
                    "type": track_type,
                }
            except Exception as e:
                logger.error(f"create_track failed: {e}")
                return {"success": False, "error": str(e)}
    
        @mcp.tool()
        def delete_track(track_index: int) -> dict:
            """Delete a track by its index."""
            try:
                project = get_project()
                track = project.tracks[track_index]
                RPR.DeleteTrack(track.id)
                return {"success": True, "deleted_index": track_index}
            except Exception as e:
                return {"success": False, "error": str(e)}
  • Registration wiring: _reg_track(mcp) is called, which triggers the @mcp.tool() decorators in track_tools.py.
    _reg_project(mcp)
    _reg_track(mcp)
  • The get_project() helper used by delete_track to obtain the current REAPER project.
    def get_project() -> reapy.Project:
        ensure_connected()
        return reapy.Project()
Behavior2/5

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

No annotations are provided, so the description must disclose behavior. It states 'delete' which implies destruction, but it does not mention side effects, permissions, or reversibility, leaving significant gaps.

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

Conciseness3/5

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

The description is very short and to the point, but it lacks necessary details, so while concise, it fails to be sufficiently informative.

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

Completeness2/5

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

Given the single parameter and no output schema, the description should provide context about the action's outcome, but it does not, leaving the agent uncertain about what happens upon deletion.

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 description coverage is 0%, so the description must compensate. It only says 'by its index' without clarifying indexing bases (0-based vs 1-based) or which track list is referenced, adding minimal value.

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?

Description clearly states the verb 'delete', the resource 'track', and the method 'by its index', which is specific and distinguishes it from sibling tools like create_track or rename_track.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives; it only mentions the method of identifying the track but lacks context about prerequisites or use cases.

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