Calculate typing score
calculate_typing_scoreUse this when a typing test has finished, or when the user gives the target passage, what they typed, and the time taken and wants their typing speed. Compares word by word and computes exact WPM = (correct characters / 5) / minutes, raw WPM (all typed characters), accuracy = correct / (correct + errors), errors (incorrect + extra + skipped letters), consistency and per-second speed (when samples are given), and the weakest keys. Returns a shareable result card (SVG) and a challenge link. Does not run a test or time anything itself; seconds must be between 1 and 3600. Do not use for reading speed or word counts.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"target_text": "<target_text>",
"typed_text": "<typed_text>",
"seconds": "<seconds>"
},
"name": "calculate_typing_score"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Settings of the test from show_typing_test, used to label the result and build a challenge link. Example: timed. | |
| seed | No | Seed from show_typing_test, e.g. 4821, so a challenge link reproduces the same passage. | |
| samples | No | Optional, sent by the widget: cumulative count of characters entered at the end of each whole second, e.g. [5, 11, 16]. Used for per-second speed and consistency. | |
| seconds | Yes | Elapsed typing time in seconds, from the first keystroke to the end (the full duration for a timed test), e.g. 60. Must be between 1 and 3600. | |
| difficulty | No | Difficulty from show_typing_test, e.g. words. | |
| focus_keys | No | Drill keys from show_typing_test, e.g. 'eth'. | |
| typed_text | Yes | Exactly what the user typed, including mistakes, e.g. 'the quikc brown fox'. May be empty. | |
| custom_text | No | Sent by the widget for custom-text tests: the full custom text from show_typing_test, e.g. 'The early bird catches the worm.', so the challenge link reproduces the whole passage. Omit otherwise. | |
| missed_keys | No | Optional, sent by the widget: one character per mistyped keystroke, giving the key that was expected (including mistakes later corrected), e.g. 'eet'. Used to find weak keys. | |
| target_text | Yes | The passage the user was asked to type, exactly as shown, e.g. 'the quick brown fox'. | |
| duration_seconds | No | Timed-test length from show_typing_test, e.g. 60. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wpm | Yes | ||
| kind | Yes | ||
| label | Yes | ||
| errors | Yes | ||
| raw_wpm | Yes | ||
| seconds | Yes | ||
| summary | Yes | ||
| accuracy | Yes | ||
| settings | Yes | ||
| completed | Yes | ||
| downloads | Yes | ||
| weak_keys | Yes | ||
| consistency | Yes | ||
| extra_chars | Yes | ||
| typed_chars | Yes | ||
| missed_chars | Yes | ||
| target_chars | Yes | ||
| correct_chars | Yes | ||
| untyped_chars | Yes | ||
| per_second_wpm | Yes | ||
| incorrect_chars | Yes |