Skip to main content
Glama
eva-wanxin-git

Windows Automation MCP Server

get_screen_size

Retrieve the dimensions of your Windows display to ensure proper window placement and content scaling.

Instructions

获取屏幕尺寸

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function implementing get_screen_size tool logic, retrieving screen size via robotjs or fallback default values.
    getScreenSize() {
      try {
        if (this.robotAvailable) {
          const size = this.robot.getScreenSize();
          return { success: true, width: size.width, height: size.height };
        } else {
          // 备用方法:使用 PowerShell
          return { success: true, width: 1920, height: 1080, note: '使用默认值' };
        }
      } catch (error) {
        return { success: false, error: error.message };
      }
    }
  • Schema definition for the get_screen_size tool, specifying name, description, and empty input schema.
    {
      name: 'get_screen_size',
      description: '获取屏幕尺寸',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Registration and dispatch of get_screen_size in the executeTool method's switch statement.
    case 'get_screen_size':
      return this.getScreenSize();
  • Tool name registered in the canHandle method's supported tools array.
    const tools = ['move_mouse', 'mouse_click', 'type_text', 'press_key', 
                   'get_mouse_position', 'get_screen_size'];
    return tools.includes(toolName);
  • Helper condition in executeTool allowing get_screen_size to run without robotjs dependency.
    if (!this.robotAvailable && name !== 'get_screen_size') {
      return { 
        success: false, 
        error: 'robotjs 未安装。请运行: npm install robotjs(需要 Windows Build Tools)' 
      };
    }
Behavior1/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 of behavioral disclosure. The description only states what the tool does ('get screen size') without revealing any behavioral traits such as whether it returns current or maximum resolution, requires specific permissions, has side effects, or handles multi-monitor setups. For a tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single phrase '获取屏幕尺寸', which is extremely concise but under-specified rather than efficiently informative. While it avoids waste, it fails to provide necessary context (e.g., what 'screen size' means, return format, or usage notes) that would help an agent use it correctly. Conciseness here comes at the cost of clarity.

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 (0 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what 'screen size' entails (e.g., resolution in pixels, physical dimensions, multi-monitor support) or the return format. For a tool that likely returns structured data, the lack of output schema means the description should compensate by detailing the response, which it doesn't do.

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 0 parameters, and schema description coverage is 100% (since there are no parameters to describe). With no parameters, the baseline score is 4, as there's nothing for the description to compensate for. The description doesn't need to add parameter semantics beyond what the empty schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '获取屏幕尺寸' (Get screen size) is a tautology that essentially restates the tool name 'get_screen_size' in Chinese. It specifies the verb ('get') and resource ('screen size'), but doesn't differentiate from siblings like 'get_system_info' or 'get_active_window' that might also provide screen-related data. The purpose is clear at a basic level but lacks specificity about what exactly is retrieved (resolution, dimensions, units).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/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., requires a display), exclusions (e.g., not for remote systems), or sibling tools that might overlap (like 'get_system_info' which could include screen data). Without any usage context, the agent must infer applicability from the name 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

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/eva-wanxin-git/windows-automation-mcp'

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