@tpmjs/tools-style-rewrite
Rewrites text to match a style guide using find/replace rules. Supports simple string replacement with find/replace or advanced regex patterns with pattern/replacement. Returns the rewritten text along with details about what changed.
Test @tpmjs/tools-style-rewrite (styleRewriteTool) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-style-rewritepnpm add @tpmjs/tools-style-rewriteyarn add @tpmjs/tools-style-rewritebun add @tpmjs/tools-style-rewritedeno add npm:@tpmjs/tools-style-rewriteimport { styleRewriteTool } from '@tpmjs/tools-style-rewrite';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { styleRewriteTool } from '@tpmjs/tools-style-rewrite';
const result = await generateText({
model: openai('gpt-4o'),
tools: { styleRewriteTool },
prompt: 'Your prompt here...',
});
console.log(result.text);Available configuration options
textstringThe text to rewrite according to the style guide
rulesarrayArray of style rules. Each rule can use find/replace for simple text replacement or pattern/replacement for regex-based replacement.
Schema extracted: 1/1/2026, 8:17:41 AM
ERROR: No README data found!
Downloads/month
44
Quality Score