# Rewrite with Xholic AI

> Only when the user explicitly asks for Xholic's rewriter. Rewrites a post or a selection by an instruction, or reviews the writing (mode review). Uses Xholic AI credits: quote first and pass confirmCredits after the user agrees. Otherwise rewrite it yourself.

`composer.rewrite` · write

- **MCP tool:** `composer_rewrite`. Catalog: reach it with `find_actions` and `run_write_action`, or turn on the full toolset.
- **REST:** `POST /v1/composer/rewrite`
- **CLI:** `xholic composer rewrite`
- **Scope:** `write`
- **Plan:** Every plan, including the trial
- **Cost:** Xholic AI: up to about 8 credits (Xholic's rewriter (a writing review costs less)). Returns a quote first; pass `confirmCredits` after the user agrees.
- **Rate limit bucket:** `write`

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `text` | string ≤ 25000 chars | Yes | The post, or the selected part to rewrite. |
| `instruction` | string ≤ 500 chars | Yes |  |
| `context` | string ≤ 25000 chars | No | The full post around a selection. |
| `mode` | "selection" \\| "post" \\| "review" | Yes |  |
| `maxCharacters` | integer 1–25000 | No |  |
| `account` | string ≤ 64 chars | No | X account to act on, as @handle. Leave it out to use the connection's default account. |
| `dryRun` | boolean | No | Return exactly what would happen without doing it. |
| `idempotencyKey` | string ≤ 200 chars | No | A unique key for this write. Repeating a call with the same key returns the first result instead of acting twice. |
| `confirmCredits` | number 0–100000 | No | Xholic AI credits the user agreed to spend. Call first without it to get the quote, show the quote to the user, and pass the amount only after they say yes. |
| `quoteId` | string ≤ 100 chars | No | The quoteId from the quote the user agreed to. Send it with confirmCredits. |
