
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given $M(1+\cos 2x,1),N(1, \sqrt {3}\sin 2x+a)$ ($x\in\mathbb{R},a\in\mathbb{R},a$ is a constant), and $y= \overrightarrow{OM}\cdot \overrightarrow{ON}$ where $O$ is the origin of the coordinate system.  
$(1)$ Find the intervals of monotonicity for the function $y=f(x)$.  
$(2)$ If $x\in\left[0, \frac {\pi}{2}\right]$ and the maximum value of $f(x)$ is $4$, find the value of $a$.

Present the answer in LaTex format: \boxed{Your answer}
user