This should work...

val MString(name) = msg.parameters("name")

If that works, you might want to use it at other places.