Writing in his column for the Sunday Telegraph, McGrath said Martyn's sudden decision to retire caught the entire team by surprise as the stylish right-hander dropped the bombshell without informing any of his teammates.
McGrath said he came to know of the development through an Internet article.
''I was at home on Friday afternoon and some friends had mentioned to my wife Jane that they heard about Marto quitting. I got on the internet and read the article,'' he wrote.
''There was no inkling in the rooms as we celebrated our stunning Test win in Adelaide on Tuesday night that he would pull the pin. I hadn't heard that he was even contemplating or thinking about it.
But he's made the decision and Marto is happy with it,'' he added.
McGrath said he immediately got in touch with Martyn through SMS.
He said Martyn told him he was happy to have escaped the intense media scrutiny of his decision and was now in a relaxed state of mind.
''I sent him a text message as soon as I found out. He responded, although I'll keep what he said private. He is just relaxing and is enjoying being free of the scrutiny he felt he was under,'' he said.
The veteran medium-pacer said the Aussies will miss the services of the middle-order bat, who despite being relatively quiet most of the times, was popular in the dressing room.
''He will be missed by the boys, both as a batsman and teammate.
He's a player I've spent a lot of time with - we played our first Test together 12 years ago - and he's become part of the family. I got on well with Marto even though we were probably different personalities.
''Behind closed doors, he liked to chat but there were other guys who would talk more in team meetings. When he did have something to say, it was definitely worth listening to. Marto wouldn't talk for the sake of talking,'' he added.
Speaking of the reasons which might have prompted Martyn to make the sudden decision, McGrath said the reserved player was never really comfortable with the media spotlight and the recent criticism and speculation surrounding his place in the side was getting to him.
''I think he got to the stage where he was not enjoying the game and all that goes with it. You have to love every minute of it otherwise it can be a hard slog.
''This summer seems to have been real tough for Marto. He played so well in the Champions Trophy tournament in India but has come back and been under media scrutiny again about whether he should be in the side. The expectations you place on yourself as well as other people put on you can make it tough,'' he explained.
McGrath, however, asserted that despite Martyn's sudden departure, the Aussies were completely focussed on getting back the Ashes and he was looking forward to his first interaction with Voges, who has been brought in as Martyn's replacement.
''I look forward to joining my team-mates in Perth today as we prepare for third Test, beginning Thursday. It will be a little strange not having Marto around, but I look forward to meeting Adam Voges, who I hear is a classy batsman,'' he said.
''We want to take hold of the Ashes in Perth. England have been able to score runs but haven't been able to bowl us out. It's going to take more than just a new spin bowler to do that,'' McGrath added.