Skip to main content
Glama
Cicatriiz

Civitai MCP Server

get_latest_models

Retrieve recently uploaded AI models from Civitai's collection, with options to specify the number of models to fetch, for enhanced discovery and selection.

Instructions

Get the newest models uploaded to Civitai

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of models to return (default: 20)

Implementation Reference

  • MCP tool handler for 'get_latest_models'. Calls CivitaiClient.getLatestModels, formats response using formatModelsResponse, and returns formatted text content.
    private async getLatestModels(args: any) {
      const response = await this.client.getLatestModels(args.limit);
      const formatted = this.formatModelsResponse(response);
      
      return {
        content: [
          {
            type: 'text',
            text: `# Latest Models\\n\\n${formatted.models.map((model: any) => 
              `**${model.name}** (${model.type})\\n` +
              `Creator: ${model.creator}\\n` +
              `Created: ${model.latestVersion ? new Date(model.latestVersion.createdAt).toLocaleDateString() : 'Unknown'}\\n` +
              `${model.description}\\n\\n`
            ).join('---\\n')}`,
          },
        ],
      };
    }
  • src/index.ts:234-242 (registration)
    Tool registration in getTools(), including name, description, and input schema definition.
      name: 'get_latest_models',
      description: 'Get the newest models uploaded to Civitai',
      inputSchema: {
        type: 'object',
        properties: {
          limit: { type: 'number', description: 'Number of models to return (default: 20)', minimum: 1, maximum: 100 },
        },
      },
    },
  • Input schema for the get_latest_models tool.
    inputSchema: {
      type: 'object',
      properties: {
        limit: { type: 'number', description: 'Number of models to return (default: 20)', minimum: 1, maximum: 100 },
      },
    },
  • Helper method in CivitaiClient that calls getModels API with sort='Newest' to fetch latest models.
    async getLatestModels(limit: number = 20): Promise<ModelsResponse> {
      return this.getModels({
        sort: 'Newest',
        limit,
        nsfw: false
      });
    }
  • Helper function to format the raw API response into a structured model list used by getLatestModels.
    private formatModelsResponse(response: any) {
      const models = response.items.map((model: any) => {
        const latestVersion = model.modelVersions[0];
        return {
          id: model.id,
          name: model.name,
          type: model.type,
          creator: model.creator.username,
          description: model.description.substring(0, 200) + (model.description.length > 200 ? '...' : ''),
          tags: model.tags.slice(0, 5), // Limit tags for readability
          nsfw: model.nsfw,
          stats: {
            downloads: model.stats?.downloadCount || 0,
            rating: model.stats?.rating || 0,
            favorites: model.stats?.favoriteCount || 0,
          },
          latestVersion: latestVersion ? {
            id: latestVersion.id,
            name: latestVersion.name,
            createdAt: latestVersion.createdAt,
            trainedWords: latestVersion.trainedWords,
          } : null,
        };
      });
    
      return {
        models,
        pagination: {
          currentPage: response.metadata.currentPage || 1,
          totalPages: response.metadata.totalPages || 1,
          totalItems: response.metadata.totalItems || models.length,
          hasNextPage: response.metadata.nextPage ? true : false,
        },
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It doesn't disclose whether this is a read-only operation, how it handles rate limits, authentication needs, or what the return format looks like (e.g., list of model objects). The phrase 'Get' implies retrieval but lacks specifics on behavior.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

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 incomplete. It doesn't explain what 'newest' means (e.g., sorting criteria), potential limitations, or return value structure, leaving significant gaps in understanding how to effectively use this tool in context with its siblings.

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 information beyond what's in the schema, which has 100% coverage for the single parameter 'limit'. Since schema coverage is high, the baseline score of 3 applies, as the description doesn't compensate but also doesn't need to given the schema's completeness.

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 action ('Get') and resource ('newest models uploaded to Civitai'), providing specific purpose. However, it doesn't explicitly differentiate from sibling tools like 'get_popular_models' or 'get_top_rated_models' which might also return recent models, so it doesn't reach the highest score.

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 like 'get_popular_models' or 'search_models'. It mentions 'newest models' but doesn't clarify if this means by upload date, version date, or another metric, leaving usage context ambiguous.

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