| name | grammarly-hello-world |
| description | Create a minimal working Grammarly example.
Use when starting a new Grammarly integration, testing your setup,
or learning basic Grammarly API patterns.
Trigger with phrases like "grammarly hello world", "grammarly example",
"grammarly quick start", "simple grammarly code".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(curl:*) |
| version | 1.8.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","grammarly","writing"] |
| compatibility | Designed for Claude Code |
Grammarly Hello World
Overview
Score a text document using Grammarly's Writing Score API. Returns an overall score plus sub-scores for engagement, correctness, tone, and clarity.
Prerequisites
- Completed
grammarly-install-auth setup
- Valid access token with
scores-api:read scope
Instructions
Step 1: Score a Document
import 'dotenv/config';
const TOKEN = process.env.GRAMMARLY_ACCESS_TOKEN!;
async function scoreText(text: string) {
const response = await fetch('https://api.grammarly.com/ecosystem/api/v2/scores', {
method: 'POST',
headers: {
'Authorization': `Bearer ${TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ text }),
});
const result = await response.json();
console.log('Overall Score:', result.overallScore);
console.log('Engagement:', result.engagement);
console.log(, result.);
.(, result.);
.(, result.);
result;
}
().(.);