get_top_rated_models
Retrieve the highest-rated AI models from Civitai's collection, filtering by time period (AllTime, Year, Month, Week, Day) and limiting results (1-100).
Instructions
Get the highest rated models
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of models to return (default: 20) | |
| period | No | Time period for rating ranking (default: AllTime) |
Implementation Reference
- src/index.ts:593-608 (handler)The primary handler function for the 'get_top_rated_models' tool. It invokes the CivitaiClient helper, formats the response using formatModelsResponse, and constructs a markdown-formatted text response listing the top-rated models.private async getTopRatedModels(args: any) { const response = await this.client.getTopRatedModels(args.period, args.limit); const formatted = this.formatModelsResponse(response); return { content: [ { type: 'text', text: `# Top Rated Models (${args.period || 'AllTime'})\\n\\n${formatted.models.map((model: any, index: number) => `${index + 1}. **${model.name}** (${model.type})\\n` + ` Creator: ${model.creator}\\n` + ` Rating: ${model.stats.rating.toFixed(1)} ⭐ (${model.stats.downloads.toLocaleString()} downloads)\\n\\n` ).join('')}`, }, ], };
- src/index.ts:243-257 (registration)Tool registration entry in the getTools() method, defining the tool name, description, and input schema for MCP tool listing.{ name: 'get_top_rated_models', description: 'Get the highest rated models', inputSchema: { type: 'object', properties: { period: { type: 'string', enum: ['AllTime', 'Year', 'Month', 'Week', 'Day'], description: 'Time period for rating ranking (default: AllTime)' }, limit: { type: 'number', description: 'Number of models to return (default: 20)', minimum: 1, maximum: 100 }, }, }, },
- src/index.ts:246-256 (schema)Input schema definition for the get_top_rated_models tool, specifying parameters for period and limit.inputSchema: { type: 'object', properties: { period: { type: 'string', enum: ['AllTime', 'Year', 'Month', 'Week', 'Day'], description: 'Time period for rating ranking (default: AllTime)' }, limit: { type: 'number', description: 'Number of models to return (default: 20)', minimum: 1, maximum: 100 }, }, },
- src/civitai-client.ts:194-201 (helper)Helper method in CivitaiClient class that constructs API parameters for fetching top-rated models (sort='Highest Rated') and calls the general getModels API method.async getTopRatedModels(period: string = 'AllTime', limit: number = 20): Promise<ModelsResponse> { return this.getModels({ sort: 'Highest Rated', period, limit, nsfw: false }); }
- src/index.ts:67-68 (handler)Dispatch case in the CallToolRequestSchema handler that routes 'get_top_rated_models' calls to the specific handler method.case 'get_top_rated_models': return await this.getTopRatedModels(args);