Pace bowler James Anderson's decision to call time on his 21-year illustrious career was the right one as England are looking to build a team for the future, managing director of the country's cricket team Robert Key said.

Anderson will retire from test cricket after the first match of the series against the West Indies at Lord's in July, he announced on Saturday.

Having made his debut for England at Lord's in 2003, Anderson will finish his career at the same ground playing his 188th test, two weeks shy of his 42nd birthday.

He has taken 700 test wickets, behind only Sri Lankan spinner Muttiah Muralitharan (800) and Australia's Shane Warne (708) on the all-time list.

"We said 'we think it's time for us to move on, that we have to start looking towards the future'," Key told the BBC Test Match Special County Cricket podcast.

"This is the right decision and this is the right time. Hopefully he gets a fantastic end at Lord's."

Head coach Brendon McCullum flew over to England to hold talks with Anderson over his future, Key said.

"We had a conversation for about an hour and a half, which Baz led. I don't think Jimmy was expecting it, but I don't think it was completely unexpected," Key said.

"We felt it was right that Jimmy and the public had the opportunity to say goodbye. We didn't impress upon him that he needed to make the decision there and then. Not so long ago he decided the Lord's game would be his last."

England's first match of a three-test series against the Caribbean side takes place from July 10-14.

(Reporting by Pearl Josephine Nazare in Bengaluru; Editing by Christian Schmollinger)