enhance_text
Expand story text to meet target length requirements by applying narrative enhancement techniques for improved content development.
Instructions
Enhances a story page using all techniques to meet expansion target
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The story page text to enhance | |
| expansionTarget | No | Target expansion percentage (default: 200) |
Implementation Reference
- src/enhancer.ts:32-43 (handler)Core handler function implementing the enhance_text tool logic. Enables all enhancement techniques and delegates to customEnhanceText method.async enhanceText(text: string, expansionTarget: number = 200): Promise<string> { // All enhancement techniques enabled const options: EnhancementOptions = { enableGoldenShadow: true, enableEnvironmental: true, enableActionScene: true, enableProseSmoother: true, enableRepetitionElimination: true }; return this.customEnhanceText(text, expansionTarget, options); }
- src/index.ts:26-41 (schema)Input schema definition for the enhance_text tool.const enhanceTextInputSchema = { type: 'object', properties: { text: { type: 'string', description: 'The story page text to enhance', }, expansionTarget: { type: 'number', description: 'Target expansion percentage (default: 200)', minimum: 100, maximum: 500 } }, required: ['text'] };
- src/index.ts:118-134 (registration)Tool registration in the ListTools response, including enhance_text definition.tools: [ { name: 'analyze_text', description: 'Analyzes a story page and generates a report with insights', inputSchema: textInputSchema }, { name: 'enhance_text', description: 'Enhances a story page using all techniques to meet expansion target', inputSchema: enhanceTextInputSchema }, { name: 'custom_enhance_text', description: 'Enhances a story page using selected techniques', inputSchema: customEnhanceTextInputSchema } ],
- src/index.ts:181-200 (handler)MCP server handler for enhance_text tool calls, validates input and delegates to EnhancementProcessor.enhanceText.private async handleEnhanceText(args: any) { if (!args.text || typeof args.text !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Missing or invalid text parameter'); } const expansionTarget = args.expansionTarget && typeof args.expansionTarget === 'number' ? args.expansionTarget : 200; const result = await this.enhancer.enhanceText(args.text, expansionTarget); return { content: [ { type: 'text', text: result } ] }; }
- src/index.ts:103-104 (helper)Instantiation of EnhancementProcessor used by enhance_text handler.this.analyzer = new TextAnalyzer(); this.enhancer = new EnhancementProcessor(this.analyzer);