Skip to main content
Glama

suggest_category

Use AI to identify the appropriate category for a course based on its title and description, helping organize educational content effectively.

Instructions

Sugere categoria mais apropriada para um curso usando IA

Input Schema

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

Implementation Reference

  • MCP tool handler for 'suggest_category': extracts input args, calls curationService.curateCourse, and returns the suggestedCategory in MCP content format.
    private async handleSuggestCategory(args: any) { const { title, description } = args; const content = { title, description }; const result = await this.curationService.curateCourse(content); return { content: [ { type: 'text', text: JSON.stringify({ suggestedCategory: result.suggestedCategory, aiEnabled: this.curationService.getAIStatus().enabled }, null, 2), }, ], }; }
  • Input schema definition for the 'suggest_category' tool, specifying required title and description fields.
    inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Título do curso' }, description: { type: 'string', description: 'Descrição do curso' }, }, required: ['title', 'description'], },
  • src/server.ts:76-96 (registration)
    Registration of tool handlers via MCP CallToolRequestSchema, including switch case dispatching 'suggest_category' to its handler.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { switch (name) { case 'suggest_category': return await this.handleSuggestCategory(args); case 'suggest_tags': return await this.handleSuggestTags(args); case 'improve_content': return await this.handleImproveContent(args); default: throw new McpError(ErrorCode.MethodNotFound, `Ferramenta desconhecida: ${name}`); } } catch (error) { if (error instanceof McpError) { throw error; } throw new McpError(ErrorCode.InternalError, `Erro ao executar ${name}: ${error}`); } });
  • src/server.ts:37-48 (registration)
    Tool specification registration in MCP ListToolsRequestSchema response, including name, description, and schema.
    { name: 'suggest_category', description: 'Sugere categoria mais apropriada para um curso usando IA', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Título do curso' }, description: { type: 'string', description: 'Descrição do curso' }, }, required: ['title', 'description'], }, },
  • Helper method in curation service that invokes AI suggestion and maps to valid category or defaults.
    private async suggestCategory(content: CourseContent): Promise<CurationSuggestion['suggestedCategory']> { const aiResult = await this.aiService.suggestCategoryWithAI(content, this.categories); if (aiResult && aiResult.categoryId) { const category = this.categories.find(c => c.id === aiResult.categoryId); if (category) { return { id: category.id, name: category.name, confidence: aiResult.confidence, reasoning: aiResult.reasoning }; } } const defaultCategory = this.categories[0]; return { id: defaultCategory.id, name: defaultCategory.name, confidence: 0.3, reasoning: 'Categoria padrão - não foi possível analisar o conteúdo' }; }

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