It is unknown what Grammatica's full capabilities are, but it's said to mirror Yūji's own personality and character. It represents Yuji's hypocrtical personality and according to Shana in the novel, it can do anything so there's no decisive counter against it. It is a spell that is later known to use multiple spells to form several combinations which can create many different effects. It complements all sorts of spells, contains many forms, and has multiple uses.
The word Grammatica (grammar in English) derives from Greek γραμματικὴ τέχνη (grammatikē technē), which means "art of letters", from γράμμα (gramma), "letter", itself from γράφειν (graphein), "to draw, to write".
In linguistics, grammar is a set of structural rules that governs the composition of clauses, phrases, and words in any given natural language.
Every speaker of a language has, in his or her head, a set of rules for using that language. This is a grammar, and the vast majority of the information in it is acquired not by conscious study or instruction, but by observing other speakers.
The naming of Yūji's spell 'Grammatica' indeed makes sense especially when Lamies called it "Fluent in Languages". By changing the word language into unrestricted spell. The clauses, phrases and words can be changed to everything needed to form an unrestricted spell (things like Power of Existence, ideas, the image of the spell in your head, and spells needed to form a more difficult spell).
It casts a protective wall of blue crystals/shards to protect the user. Yūji first used it to protect himself from Shana's flames because the Azure could not hold it back. Yūji again tried using this spell to protect the World Egg from Shana's attack after he learned it, however as he had not mastered the spell the protective wall easily cracked, and finally broke into pieces allowing Shana's attack through to the World Egg. Through speculation, Yūji failed because he tried to recreate the effect of the spell that protected him from Shana's flames. However, Shana's attack was a physical fist, not through flames so the protective wall broke down since it was incompatible.
Yūji uses this spell for the first time after Xanadu has been created, using it to quickly bridge the gap between him and Yoshida Kazumi on the Misaki Bridge, surprising both Shana and Margery with the speed in which he performs the act.
Yūji uses this spell for the first time when he fights with Shana over the Misaki Bridge, using it to attract, and neutralize Chorde which Shana had utilized against him.
He uses this spell in order to recreate Shaher's effect to make it so everyone in the area can hear his voice. He uses it to make the humans remember the scene of them battling.
He uses this spell to surround Yoshida like a bird cage to protect her.