yeah, the problem with the phrase "written by" is that it includes both composition and lyrics.
i guess sometimes digging deeper beyond credits (e.g. interviews, documentaries, books) may give you more detail, and other times you can pretty much assume who was responsible for the lyrics/composition judging by the individuals' known roles (e.g. producers' names on writing credits usually mean composition, but obviously not always). and then you have the issue of just how much a lyricist or a composer contributed to the collaboration.
some 'making-of' stories have been told or are generally known by fans, but i too would prefer it if all credits had more emphasis on detailed roles.