Skip to main content
Glama
nickbaumann98

EverArt Forge MCP Server

view_image

Open stored images in your default viewer to review generated artwork from the EverArt Forge MCP Server.

Instructions

Open a stored image in the default image viewer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesName of the image file to view

Implementation Reference

  • The handler for the 'view_image' tool. It takes a filename argument, constructs the full path using STORAGE_DIR, verifies the file exists, reads it for potential inline display, opens the image in the system's default viewer using the 'open' library, and returns a success message with the file path.
    case "view_image": {
      try {
        const args = request.params.arguments as any;
        
        // Validate filename
        if (!args.filename || typeof args.filename !== 'string') {
          return errorResponse({
            type: EverArtErrorType.VALIDATION_ERROR,
            message: "filename is required and must be a string"
          });
        }
        
        const filename = args.filename;
        const filepath = path.join(STORAGE_DIR, filename);
    
        try {
          // Check if file exists
          await fs.access(filepath);
        } catch (accessError) {
          // List available files to help the user
          const availableFiles = await listStoredImages();
          let errorMsg = `Image not found: ${filename}`;
          
          if (availableFiles.length > 0) {
            const suggestions = availableFiles
              .filter(f => f.toLowerCase().includes(filename.toLowerCase()) || 
                          filename.toLowerCase().includes(f.toLowerCase().split('_').pop() || ''))
              .slice(0, 3);
              
            if (suggestions.length > 0) {
              errorMsg += `\n\nDid you mean one of these?\n` + 
                        suggestions.map(s => `• ${s}`).join('\n');
            }
            
            errorMsg += `\n\nUse 'list_images' to see all available images.`;
          }
          
          return errorResponse({
            type: EverArtErrorType.VALIDATION_ERROR,
            message: errorMsg
          });
        }
    
        // Read the image for inline display
        let imageData: string | undefined;
        let mimeType: string = 'application/octet-stream';
        
        try {
          const content = await fs.readFile(filepath);
          imageData = content.toString('base64');
          const ext = path.extname(filename).slice(1).toLowerCase();
          mimeType = getMimeType(ext);
        } catch (error) {
          console.warn("Unable to read image for inline display:", error);
          // Continue without inline display if reading fails
        }
    
        await open(filepath);
        
        // Skip opening in external viewer since we'll show in MCP
        try {
          // If we got here, cancel the auto-open to avoid duplicate windows
          // await open(filepath);
        } catch (openError) {
          // Ignore error
        }
        
        return {
          content: [
            { 
              type: "text", 
              text: `✅ Viewing image: ${filename}` 
            },
            {
              type: "text",
              text: `Image opened in default viewer.\nFile path: file://${filepath}`
            }
          ],
        };
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : "Unknown error";
        return errorResponse({
          type: EverArtErrorType.UNKNOWN_ERROR,
          message: `Error viewing image: ${errorMessage}`
        });
      }
    }
  • src/index.ts:427-440 (registration)
    Tool registration in the ListToolsRequestSchema handler, including the tool's name, description, and input schema definition.
    {
      name: "view_image",
      description: "Open a stored image in the default image viewer",
      inputSchema: {
        type: "object",
        properties: {
          filename: {
            type: "string",
            description: "Name of the image file to view",
          },
        },
        required: ["filename"],
      },
    },
  • Input schema for the 'view_image' tool, specifying a required 'filename' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        filename: {
          type: "string",
          description: "Name of the image file to view",
        },
      },
      required: ["filename"],
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool opens an image in a viewer, implying a read-only operation, but lacks details on behavioral traits such as whether it requires specific permissions, if it launches an external application, or any error handling (e.g., if the file doesn't exist). This leaves gaps for safe agent invocation.

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 is 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 tool's simplicity (one parameter, no output schema), the description is minimal but incomplete. It lacks context on usage guidelines, behavioral transparency (e.g., what happens if the file is missing), and doesn't leverage the absence of annotations to compensate, making it inadequate for safe agent operation.

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 the input schema, which has 100% coverage and fully documents the single 'filename' parameter. This meets the baseline of 3, as the schema handles the heavy lifting, but the description doesn't provide additional context like file format support or path specifications.

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 ('Open') and resource ('stored image'), specifying it opens in the default image viewer. However, it doesn't explicitly differentiate from sibling tools like 'generate_image' (creates new images) or 'list_images' (lists existing images), which is a minor gap.

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. It doesn't mention prerequisites (e.g., the image must already exist), exclusions, or comparisons to sibling tools like 'generate_image' for creating images or 'list_images' for browsing available images.

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

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/nickbaumann98/everart-forge-mcp'

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