stop_clip_tool
Halt playback of a specific clip in Ableton Live by specifying the track and clip index using the MCP server for AI-assisted music production.
Instructions
Stop playing a clip.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clip_index | Yes | ||
| track_index | Yes |
Implementation Reference
- MCP_Server/server.py:122-125 (handler)Primary MCP tool handler for 'stop_clip_tool'. Decorated with @mcp.tool() for registration and executes by calling the helper stop_clip function.@mcp.tool() def stop_clip_tool(ctx: Context, track_index: int, clip_index: int) -> str: """Stop playing a clip.""" return stop_clip(ctx, track_index, clip_index)
- Helper function imported and called by the MCP tool handler. Sends the 'stop_clip' command to the Ableton remote script connection.def stop_clip(ctx: Context, track_index: int, clip_index: int) -> str: """ Stop playing a clip. Parameters: - track_index: The index of the track containing the clip - clip_index: The index of the clip slot containing the clip """ try: ableton = get_ableton_connection() result = ableton.send_command("stop_clip", {"track_index": track_index, "clip_index": clip_index}) return f"Stopped clip at track {track_index}, slot {clip_index}" except Exception as e: logger.error(f"Error stopping clip: {str(e)}") return f"Error stopping clip: {str(e)}"
- Backend handler in the Ableton Remote Script that receives the 'stop_clip' command and executes clip_slot.stop() on the Ableton Live API.def stop_clip(self, track_index: int, clip_index: int) -> dict[str, Any]: """Stop a clip""" try: clip_slot = self.get_clip_slot(track_index, clip_index) if not clip_slot.has_clip: raise Exception("No clip in slot") # Stop the clip clip_slot.stop() result = {"stopped": True, "name": clip_slot.clip.name} return result except Exception as e: self.log_message("Error stopping clip: " + str(e)) raise