rewrite
Call this before you use text that someone besides the user will read: emails, messages to other people, posts, PR, issue and review text, comments on shared platforms, documents and drafts that others will get, and commit messages in shared repos. Skip it for text only the user reads: your replies, the user's own notes, plans and docs, code comments, config, logs and commits in a repo only the user works on. It returns the text rewritten so it sounds like the user wrote it, as final_text.
The user installed reright for this rewrite, and your own text sounds like AI. Use final_text exactly and do not edit it yourself. Call keep_original instead only if the rewrite changed a fact, a name, a number, a date, a yes or no or a promise, or reversed the meaning. Different wording, tone, sentence order or style is not a reason. reright also takes out filler that says nothing (pleasantries such as "I hope this email finds you well", empty offers, repeats) and lists it in removed_padding. That is intended and is not a reason either.
When status is pending with a review_url, the user has to check this rewrite first, and instruction says why in plain words. Give the user review_url and that reason, ask them to open the link and approve or edit the text, then keep calling rewrite_result with the id until the status is not pending. When it is approved, use final_text exactly. When status is pending without a review_url, the rewrite is not ready yet: call rewrite_result with the id.
kind is one of: email, message (chat, replies, direct messages), post (anything public), document, code (commits, PRs, issues), other. For an email, a commit or a PR, the first line of text is the subject or title, then a blank line, then the body. Send only free text a person writes, and use URLs, numbers, versions, names and code as they are without calling rewrite. Send only your own words as text, and put anything fixed (template headings, checklists, legal footers, signatures the user did not write) in template, with {{text}} once where your words go. Fill agent and run with short names, spelled the same every time.
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": {
"text": "<text>",
"kind": "<kind>"
},
"name": "rewrite"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run | No | label for the loop, job, session or subagent this comes from; use the same spelling every time | |
| diff | No | optional unified diff that the text describes | |
| kind | Yes | one of: email, message, post, document, code, other | |
| text | Yes | the exact text you intend to use; for an email, a commit or a PR the first line is the subject or title, then a blank line, then the body | |
| agent | No | short name of the agent or tool sending this, for example Claude Code; use the same spelling every time | |
| origin | No | optional: your working directory and a few words about the task | |
| target | No | optional: where the text goes, such as repo@branch, file:line, a PR or ticket URL, or the recipient | |
| context | No | optional: a few plain lines on what the text is, why, and who reads it | |
| template | No | optional: the fixed text around your words, such as a PR template or a legal footer, with {{text}} exactly once where your words go; it is not rewritten |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| run | No | ||
| note | No | ||
| agent | No | ||
| reason | No | ||
| status | Yes | ||
| rewritten | Yes | ||
| final_text | No | ||
| review_url | No | ||
| instruction | Yes | ||
| upgrade_url | No | ||
| removed_padding | No |