Skip to main content
Glama
Cicatriiz

Civitai MCP Server

browse_images

Explore and filter AI-generated images from Civitai by model, creator, or content level. Customize results with pagination, sorting, and time period filters.

Instructions

Browse AI-generated images from Civitai

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of images to return (1-200, default 100)
modelIdNoFilter images from a specific model
modelVersionIdNoFilter images from a specific model version
nsfwNoNSFW content level filter
pageNoPage number for pagination
periodNoTime period for sorting
postIdNoGet images from a specific post
sortNoSort order for images
usernameNoFilter images by creator username

Implementation Reference

  • The handler function that implements the core logic for the 'browse_images' tool. It invokes the CivitaiClient to fetch images and formats a detailed text response listing image details including IDs, creators, dimensions, NSFW levels, reactions, URLs, and generation info.
    private async browseImages(args: any) {
      const response = await this.client.getImages(args);
      
      return {
        content: [
          {
            type: 'text',
            text: `Found ${response.metadata.totalItems || response.items.length} images:\\n\\n${response.items.map(image => 
              `**Image ID:** ${image.id}\\n` +
              `**Creator:** ${image.username || 'Unknown'}\\n` +
              `**Dimensions:** ${image.width}x${image.height}\\n` +
              `**NSFW Level:** ${image.nsfwLevel || 'Unknown'}\\n` +
              `**Reactions:** ❤️ ${image.stats?.heartCount || 0} | 👍 ${image.stats?.likeCount || 0} | 💬 ${image.stats?.commentCount || 0}\\n` +
              `**URL:** ${image.url}\\n` +
              `**Created:** ${image.createdAt ? new Date(image.createdAt).toLocaleDateString() : 'Unknown'}\\n` +
              (image.meta ? `**Generation Info:** ${JSON.stringify(image.meta, null, 2).substring(0, 200)}...\\n` : '') +
              '\\n'
            ).join('---\\n')}\\nPage ${response.metadata.currentPage || 1}`,
          },
        ],
      };
    }
  • Input schema defining the parameters for the 'browse_images' tool, including limits, pagination, filters for models, versions, posts, users, NSFW levels, sorting, and periods.
    inputSchema: {
      type: 'object',
      properties: {
        limit: { type: 'number', description: 'Number of images to return (1-200, default 100)', minimum: 1, maximum: 200 },
        page: { type: 'number', description: 'Page number for pagination', minimum: 1 },
        modelId: { type: 'number', description: 'Filter images from a specific model' },
        modelVersionId: { type: 'number', description: 'Filter images from a specific model version' },
        postId: { type: 'number', description: 'Get images from a specific post' },
        username: { type: 'string', description: 'Filter images by creator username' },
        nsfw: { 
          type: 'string',
          enum: ['None', 'Soft', 'Mature', 'X'],
          description: 'NSFW content level filter'
        },
        sort: {
          type: 'string',
          enum: ['Most Reactions', 'Most Comments', 'Newest'],
          description: 'Sort order for images'
        },
        period: {
          type: 'string',
          enum: ['AllTime', 'Year', 'Month', 'Week', 'Day'],
          description: 'Time period for sorting'
        }
      },
    },
  • src/index.ts:57-58 (registration)
    Registration of the 'browse_images' handler in the main tool dispatch switch statement within the CallToolRequestSchema handler.
    case 'browse_images':
      return await this.browseImages(args);
  • src/index.ts:164-193 (registration)
    Tool registration in the getTools() method, which provides the tool list to the MCP ListToolsRequestSchema, including name, description, and input schema.
    {
      name: 'browse_images',
      description: 'Browse AI-generated images from Civitai',
      inputSchema: {
        type: 'object',
        properties: {
          limit: { type: 'number', description: 'Number of images to return (1-200, default 100)', minimum: 1, maximum: 200 },
          page: { type: 'number', description: 'Page number for pagination', minimum: 1 },
          modelId: { type: 'number', description: 'Filter images from a specific model' },
          modelVersionId: { type: 'number', description: 'Filter images from a specific model version' },
          postId: { type: 'number', description: 'Get images from a specific post' },
          username: { type: 'string', description: 'Filter images by creator username' },
          nsfw: { 
            type: 'string',
            enum: ['None', 'Soft', 'Mature', 'X'],
            description: 'NSFW content level filter'
          },
          sort: {
            type: 'string',
            enum: ['Most Reactions', 'Most Comments', 'Newest'],
            description: 'Sort order for images'
          },
          period: {
            type: 'string',
            enum: ['AllTime', 'Year', 'Month', 'Week', 'Day'],
            description: 'Time period for sorting'
          }
        },
      },
    },
  • Supporting helper method in CivitaiClient that performs the actual API request to Civitai's /images endpoint using the provided parameters and validates the response with ImagesResponseSchema.
    async getImages(params: ImagesParams = {}): Promise<ImagesResponse> {
      const url = this.buildUrl('/images', params);
      return this.makeRequest<ImagesResponse>(url, ImagesResponseSchema);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'browse' but doesn't disclose behavioral traits such as pagination details (implied by 'page' parameter), rate limits, authentication needs, or what the output looks like (e.g., image metadata vs. URLs). This is a significant gap for a tool with 9 parameters and no output schema.

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 for an agent 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?

Given the complexity (9 parameters, no annotations, no output schema), the description is incomplete. It doesn't cover behavioral aspects like pagination, rate limits, or output format, which are crucial for effective tool use. The schema handles parameters well, but the overall context lacks necessary operational details.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description doesn't add any meaning beyond the schema, such as explaining parameter interactions or default behaviors. Baseline 3 is appropriate as the schema does the heavy lifting, but no extra value is added.

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 ('browse') and resource ('AI-generated images from Civitai'), making the purpose evident. However, it doesn't differentiate from sibling tools like 'search_models' or 'get_latest_models', which might also involve browsing or retrieving content, so it lacks explicit sibling distinction.

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. With sibling tools like 'search_models' or 'get_popular_models', the description doesn't clarify if this is for general browsing, filtered exploration, or specific use cases, leaving the agent without usage context.

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