Skip to main content
Glama

improve_content

Optimize course titles and descriptions by applying content best practices to enhance clarity and engagement.

Instructions

Melhora título e descrição de um curso seguindo boas práticas

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTítulo atual do curso
descriptionYesDescrição atual do curso

Implementation Reference

  • src/server.ts:61-72 (registration)
    Registration of the 'improve_content' tool in the ListTools response, including name, description, and input schema definition.
    {
      name: 'improve_content',
      description: 'Melhora título e descrição de um curso seguindo boas práticas',
      inputSchema: {
        type: 'object',
        properties: {
          title: { type: 'string', description: 'Título atual do curso' },
          description: { type: 'string', description: 'Descrição atual do curso' },
        },
        required: ['title', 'description'],
      },
    },
  • Primary handler function for executing the 'improve_content' tool logic. Extracts input args, invokes curation service, and formats JSON response with title and description improvements.
    private async handleImproveContent(args: any) {
      const { title, description } = args;
      const content = { title, description };
      const result = await this.curationService.curateCourse(content);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              titleImprovement: result.titleImprovement,
              descriptionImprovement: result.descriptionImprovement,
              aiEnabled: this.curationService.getAIStatus().enabled
            }, null, 2),
          },
        ],
      };
    }
  • Core helper function implementing AI-powered title improvement using OpenAI GPT with a tailored prompt for course title best practices.
    async improveTitleWithAI(title: string, description: string): Promise<{
      suggestion: string;
      reasoning: string;
      improvements: string[];
    } | null> {
      if (!this.enabled) return null;
    
      try {
        const prompt = `
          Analise e melhore o seguinte título de curso:
    
          TÍTULO ATUAL: ${title}
          DESCRIÇÃO: ${description}
    
          Considere as boas práticas:
          - Comprimento ideal: 30-60 caracteres
          - Incluir nível (iniciante, intermediário, avançado)
          - Usar palavras-chave relevantes
          - Ser específico e claro
          - Usar números quando apropriado
    
          Responda em formato JSON:
          {
            "suggestion": "título_melhorado",
            "reasoning": "explicação_das_mudanças",
            "improvements": ["lista", "de", "melhorias", "aplicadas"]
          }
    
          Se o título já estiver bom, mantenha similar mas otimizado.
        `;
    
        const response = await this.openai.chat.completions.create({
          model: this.AIMODEL,
          messages: [{
            role: 'user',
            content: prompt
          }],
          temperature: 0.4,
          max_tokens: 250
        });
    
        const result = JSON.parse(response.choices[0].message.content || '{}');
        return result;
      } catch (error) {
        console.error('Error in AI title improvement:', error);
        return null;
      }
    }
  • Core helper function implementing AI-powered description improvement using OpenAI GPT with best practices prompt for course descriptions.
    async improveDescriptionWithAI(title: string, description: string): Promise<{
      suggestion: string;
      reasoning: string;
      improvements: string[];
    } | null> {
      if (!this.enabled) return null;
    
      try {
        const prompt = `
          Melhore a seguinte descrição de curso:
    
          TÍTULO: ${title}
          DESCRIÇÃO ATUAL: ${description}
    
          Boas práticas para descrições:
          - Comprimento ideal: 100-300 caracteres
          - Começar com benefício/resultado
          - Usar verbos de ação (aprenda, domine, desenvolva)
          - Incluir o que será aprendido
          - Call-to-action sutil
          - Linguagem clara e envolvente
    
          Responda em formato JSON:
          {
            "suggestion": "descrição_melhorada",
            "reasoning": "explicação_das_mudanças",
            "improvements": ["lista", "de", "melhorias", "aplicadas"]
          }
        `;
    
        const response = await this.openai.chat.completions.create({
          model: this.AIMODEL,
          messages: [{
            role: 'user',
            content: prompt
          }],
          temperature: 0.4,
          max_tokens: 350
        });
    
        const result = JSON.parse(response.choices[0].message.content || '{}');
        return result;
      } catch (error) {
        console.error('Error in AI description improvement:', error);
        return null;
      }
    }
  • Service method invoked by the handler that coordinates category/tag suggestions and content improvements, calling specific improveTitle and improveDescription methods.
    async curateCourse(content: CourseContent): Promise<CurationSuggestion> {
      if (!this.aiService.isEnabled()) {
        throw new Error('OpenAI API key is required. Please set OPENAI_API_KEY environment variable.');
      }
    
      const [
        suggestedCategory,
        suggestedTags,
        titleImprovement,
        descriptionImprovement
      ] = await Promise.all([
        this.suggestCategory(content),
        this.suggestTags(content),
        this.config.enableTitleSuggestions ? this.improveTitle(content.title, content.description) : Promise.resolve(undefined),
        this.config.enableDescriptionSuggestions ? this.improveDescription(content.title, content.description) : Promise.resolve(undefined)
      ]);
    
      return {
        suggestedCategory,
        suggestedTags,
        titleImprovement,
        descriptionImprovement
      };
    }

Tool Definition Quality

Score is being calculated. Check back soon.

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/alexandrekumagae/ai-content-categorization-mcp'

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