Skip to main content
Glama
Cicatriiz

Civitai MCP Server

get_model

Retrieve detailed information about a specific AI model using its unique ID. Enables users to access model details through the Civitai MCP Server for informed AI assistant interactions.

Instructions

Get detailed information about a specific model by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelIdYesThe ID of the model to retrieve

Implementation Reference

  • The primary handler function for the 'get_model' MCP tool. Extracts modelId, fetches data via CivitaiClient, formats with formatSingleModel, and returns MCP-formatted text response.
    private async getModel(args: any) {
      const { modelId } = args;
      const model = await this.client.getModel(modelId);
      const formatted = this.formatSingleModel(model);
      
      return {
        content: [
          {
            type: 'text',
            text: `# ${formatted.name}\\n\\n` +
              `**Type:** ${formatted.type}\\n` +
              `**Creator:** ${formatted.creator.username}\\n` +
              `**Downloads:** ${formatted.stats.downloadCount?.toLocaleString() || 0}\\n` +
              `**Rating:** ${formatted.stats.rating?.toFixed(1) || 'N/A'} (${formatted.stats.ratingCount || 0} ratings)\\n` +
              `**NSFW:** ${formatted.nsfw ? 'Yes' : 'No'}\\n\\n` +
              `**Tags:** ${formatted.tags.join(', ')}\\n\\n` +
              `**Description:**\\n${formatted.description}\\n\\n` +
              `**Versions (${formatted.versions.length}):**\\n${formatted.versions.map((v: any) => 
                `- **${v.name}** (ID: ${v.id})\\n  ` +
                `Created: ${new Date(v.createdAt).toLocaleDateString()}\\n  ` +
                `Downloads: ${v.stats.downloadCount?.toLocaleString() || 0}\\n  ` +
                `Trained words: ${v.trainedWords.join(', ') || 'None'}\\n  ` +
                `Files: ${v.files.length} file(s)\\n`
              ).join('\\n')}`,
          },
        ],
      };
    }
  • Input schema definition for the 'get_model' tool in the tools list returned by ListToolsRequest.
    {
      name: 'get_model',
      description: 'Get detailed information about a specific model by ID',
      inputSchema: {
        type: 'object',
        properties: {
          modelId: { type: 'number', description: 'The ID of the model to retrieve' },
        },
        required: ['modelId'],
      },
    },
  • src/index.ts:51-52 (registration)
    Dispatch registration mapping tool name 'get_model' to its handler in CallToolRequestSchema handler.
    case 'get_model':
      return await this.getModel(args);
  • Helper function to format raw model data into structured object used by get_model handler.
    private formatSingleModel(model: any) {
      return {
        id: model.id,
        name: model.name,
        description: model.description,
        type: model.type,
        creator: {
          username: model.creator.username,
          avatar: model.creator.image,
        },
        tags: model.tags,
        nsfw: model.nsfw,
        stats: model.stats,
        versions: model.modelVersions.map((version: any) => ({
          id: version.id,
          name: version.name,
          description: version.description,
          createdAt: version.createdAt,
          trainedWords: version.trainedWords,
          downloadUrl: version.downloadUrl,
          stats: version.stats,
          files: version.files.map((file: any) => ({
            sizeKb: file.sizeKb,
            format: file.metadata?.format,
            fp: file.metadata?.fp,
            primary: file.primary,
            scanStatus: {
              pickle: file.pickleScanResult,
              virus: file.virusScanResult,
            },
          })),
          imageCount: version.images.length,
        })),
      };
    }
  • CivitaiClient.getModel method: constructs API URL and makes validated fetch request to retrieve model data.
    async getModel(modelId: number): Promise<Model> {
      const url = this.buildUrl(`/models/${modelId}`);
      return this.makeRequest<Model>(url, ModelSchema);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves 'detailed information', but doesn't specify what that includes (e.g., metadata, statistics, permissions), whether it's a read-only operation, or any constraints like rate limits or authentication needs. This leaves significant gaps for a tool that likely interacts with a model database.

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 parse quickly.

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 'detailed information' entails in the return values, nor does it address behavioral aspects like error handling or data freshness. Given the complexity implied by sibling tools (e.g., versioning, searching), more context is needed for effective use.

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 input schema has 100% description coverage, clearly documenting the 'modelId' parameter as a number. The description adds minimal value beyond this, only reinforcing that it retrieves information 'by ID'. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't provide additional semantic context.

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 verb ('Get') and resource ('detailed information about a specific model by ID'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_model_version' or 'get_latest_models', which could also retrieve model information in different contexts.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_models_by_type', 'search_models', or 'get_model_version'. The description implies usage for retrieving details of a known model ID, but lacks explicit when/when-not instructions or references to sibling tools.

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