Skip to main content
Glama

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
NameRequiredDescriptionDefault
textYesThe story page text to enhance
expansionTargetNoTarget expansion percentage (default: 200)

Implementation Reference

  • 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);
    }
  • 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
      }
    ],
  • 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
          }
        ]
      };
    }
  • Instantiation of EnhancementProcessor used by enhance_text handler.
    this.analyzer = new TextAnalyzer();
    this.enhancer = new EnhancementProcessor(this.analyzer);
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MushroomFleet/UNO-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server