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
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Título do curso | |
| description | Yes | Descrição do curso |
Implementation Reference
- src/server.ts:99-115 (handler)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), }, ], }; }
- src/server.ts:40-47 (schema)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' }; }