Skip to main content
Glama

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
NameRequiredDescriptionDefault
limitNoNumber of models to return (default: 20)
periodNoTime period for rating ranking (default: AllTime)

Implementation Reference

  • 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 }, }, }, },
  • 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 }, }, },
  • 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 }); }
  • 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);

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/Cicatriiz/civitai-mcp-server'

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