Skip to main content
Glama
Cicatriiz

Civitai MCP Server

get_popular_models

Retrieve top popular or downloaded AI models from Civitai’s collection, filtered by time period (AllTime, Year, Month, Week, Day) and customizable limit (up to 100 models).

Instructions

Get the most popular/downloaded models

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of models to return (default: 20)
periodNoTime period for popularity ranking (default: Week)

Implementation Reference

  • MCP tool handler method that calls the client, formats the response, and returns formatted text content listing the most popular models.
    private async getPopularModels(args: any) {
      const response = await this.client.getPopularModels(args.period, args.limit);
      const formatted = this.formatModelsResponse(response);
      
      return {
        content: [
          {
            type: 'text',
            text: `# Most Popular Models (${args.period || 'Week'})\\n\\n${formatted.models.map((model: any, index: number) => 
              `${index + 1}. **${model.name}** (${model.type})\\n` +
              `   Creator: ${model.creator}\\n` +
              `   Downloads: ${model.stats.downloads.toLocaleString()}\\n` +
              `   Rating: ${model.stats.rating.toFixed(1)} ⭐\\n\\n`
            ).join('')}`,
          },
        ],
      };
    }
  • src/index.ts:219-232 (registration)
    Tool registration in the list of available MCP tools, including name, description, and input schema definition.
      name: 'get_popular_models',
      description: 'Get the most popular/downloaded models',
      inputSchema: {
        type: 'object',
        properties: {
          period: {
            type: 'string',
            enum: ['AllTime', 'Year', 'Month', 'Week', 'Day'],
            description: 'Time period for popularity ranking (default: Week)'
          },
          limit: { type: 'number', description: 'Number of models to return (default: 20)', minimum: 1, maximum: 100 },
        },
      },
    },
  • Supporting client method that fetches popular models from Civitai API by calling getModels with 'Most Downloaded' sort and specified period/limit.
    async getPopularModels(period: string = 'Week', limit: number = 20): Promise<ModelsResponse> {
      return this.getModels({
        sort: 'Most Downloaded',
        period,
        limit,
        nsfw: false
      });
    }
  • Zod schema for validating the ModelsResponse returned by the Civitai API, used in the client methods.
    export const ModelsResponseSchema = z.object({
      items: z.array(ModelSchema),
      metadata: MetadataSchema,
    });
  • src/index.ts:63-64 (registration)
    Dispatch case in the CallToolRequest handler that routes 'get_popular_models' calls to the handler method.
    case 'get_popular_models':
      return await this.getPopularModels(args);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It mentions 'most popular/downloaded' but doesn't clarify whether popularity is based on downloads, views, likes, or other metrics, nor does it address pagination, rate limits, authentication requirements, or response format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just 5 words, with zero wasted language. It's front-loaded with the core purpose and uses efficient phrasing, making it easy to parse while still conveying the essential function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'popular' means operationally, how results are sorted, what data is returned, or any behavioral constraints. Given the context of multiple sibling tools with overlapping functions, more guidance is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter semantics beyond what's already in the schema, which has 100% coverage with clear descriptions for both 'limit' and 'period'. The baseline score of 3 reflects adequate parameter documentation through the schema alone, with no additional value from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('most popular/downloaded models'), making it immediately understandable. However, it doesn't explicitly differentiate from siblings like 'get_latest_models' or 'get_top_rated_models', which reduces clarity about when to choose this specific tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_latest_models', 'get_top_rated_models', and 'search_models', there's no indication of when popularity-based retrieval is preferred over recency, rating, or search-based approaches.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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