The serial monitor can only send and receive UART serial data.
The usual way to proceed is to develop a serial protocol (and corresponding Arduino code) that reads the serial input, changes variables on the fly, executes functions, possibly with parameters from the input stream, etc.
The Serial Input Basics tutorial on this forum is one place to start.