Skip to main content
Glama
rubinsh

MCP Windows Screenshots

by rubinsh

list_directories

Retrieve all configured screenshot directories from the MCP Windows Screenshots server, enabling easy access and sharing of screenshots without navigating complex file paths.

Instructions

List all configured screenshot directories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler for the 'list_directories' tool. It fetches default and custom screenshot directories, checks if they exist, and returns a JSON-formatted list with additional metadata.
    case 'list_directories': {
      const defaultDirs = getScreenshotDirectories();
      const customDirs = getCustomDirectories();
      
      const dirInfo = await Promise.all(
        [...defaultDirs, ...customDirs].map(async (dir) => {
          try {
            await stat(dir);
            return { path: dir, exists: true };
          } catch {
            return { path: dir, exists: false };
          }
        })
      );
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              default_directories: dirInfo.filter((_, i) => i < defaultDirs.length),
              custom_directories: dirInfo.filter((_, i) => i >= defaultDirs.length),
              environment_variable: 'MCP_SCREENSHOT_DIRS',
              current_value: process.env.MCP_SCREENSHOT_DIRS || '(not set)',
              windows_username: process.env.WINDOWS_USERNAME || '(not set)',
              usage: 'Set MCP_SCREENSHOT_DIRS=/path/to/dir or use semicolon for multiple: /path/1;/path/2',
            }, null, 2),
          },
        ],
      };
    }
  • src/index.ts:220-226 (registration)
    Registration of the 'list_directories' tool in the tools array, including name, description, and empty input schema (no parameters required).
      name: 'list_directories',
      description: 'List all configured screenshot directories',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Input schema for the 'list_directories' tool, which expects no parameters.
    inputSchema: {
      type: 'object',
      properties: {},
    },
  • Key helper function that generates the list of default screenshot directories, adapting to WSL, Windows, or Linux environments and querying the Windows registry for the screenshots folder.
    const getScreenshotDirectories = (): string[] => {
      const username = os.userInfo().username;
      const windowsUsername = process.env.WINDOWS_USERNAME || username;
      const env = detectEnvironment();
      
      // Try to get the actual Screenshots folder from registry first
      const registryPath = getWindowsScreenshotPath();
      const directories: string[] = [];
      
      if (registryPath) {
        directories.push(registryPath);
      }
      
      // Add default paths based on environment
      if (env.type === 'wsl') {
        // WSL paths
        directories.push(
          `/mnt/c/Users/${windowsUsername}/Pictures/Screenshots`,
          `/mnt/c/Users/${windowsUsername}/Pictures`,
          `/mnt/c/Users/${windowsUsername}/OneDrive/Pictures/Screenshots`,
          `/mnt/c/Users/${windowsUsername}/OneDrive/Pictures 2/Screenshots 1`,
          `/mnt/c/Users/${windowsUsername}/Documents/Screenshots`,
          `/mnt/c/Users/${windowsUsername}/Desktop`,
          `/mnt/c/Users/${windowsUsername}/AppData/Local/Temp`,
          `/mnt/c/Windows/Temp`
        );
      } else if (env.type === 'windows') {
        // Native Windows paths
        directories.push(
          `C:\\Users\\${windowsUsername}\\Pictures\\Screenshots`,
          `C:\\Users\\${windowsUsername}\\Pictures`,
          `C:\\Users\\${windowsUsername}\\OneDrive\\Pictures\\Screenshots`,
          `C:\\Users\\${windowsUsername}\\OneDrive\\Pictures 2\\Screenshots 1`,
          `C:\\Users\\${windowsUsername}\\Documents\\Screenshots`,
          `C:\\Users\\${windowsUsername}\\Desktop`,
          `C:\\Users\\${windowsUsername}\\AppData\\Local\\Temp`,
          `C:\\Windows\\Temp`
        );
      }
      
      // Remove duplicates
      return [...new Set(directories)];
    };
  • Helper function to parse custom screenshot directories from the MCP_SCREENSHOT_DIRS environment variable, supporting semicolon-separated lists.
    const getCustomDirectories = (): string[] => {
      // Check for multiple directories first (semicolon-separated)
      const customDirs = process.env.MCP_SCREENSHOT_DIRS;
      if (!customDirs) return [];
      
      // If it contains semicolons, split by semicolon
      if (customDirs.includes(';')) {
        return customDirs.split(';').filter(dir => dir.trim());
      }
      
      // Otherwise, treat as a single directory
      return [customDirs.trim()];
    };
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. It states what the tool does but doesn't describe return format, pagination behavior, error conditions, or whether this operation has side effects. For a tool with zero annotation coverage, this represents significant gaps in behavioral transparency.

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 communicates the core purpose without any wasted words. It's appropriately sized for a simple tool with no parameters and gets straight to the point.

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

Completeness3/5

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

For a zero-parameter tool with no output schema, the description adequately states what the tool does but lacks important context about return format and behavioral characteristics. Given the simplicity of the tool (no parameters, no complex schema), the description meets minimum viability but could be more complete about what 'list' actually returns.

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

Parameters4/5

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

The tool has zero parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't discuss parameters since none exist, earning a baseline score of 4 for this dimension.

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 'List' and the resource 'all configured screenshot directories', making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'list_screenshots', but the resource focus (directories vs screenshots) provides implicit 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?

The description provides no guidance on when to use this tool versus the sibling 'list_screenshots' tool, nor does it mention any prerequisites, context requirements, or alternative approaches. The agent must infer usage from the tool name and description alone.

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/rubinsh/mcp-windows-screenshots'

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