Skip to main content
Glama
JackXuyi

Current operating environment

getTerminalTypes

Retrieve all supported terminal types available in the current operating environment to identify compatible interfaces.

Instructions

获取系统上支持的所有终端类型

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'getTerminalTypes' tool. It attempts to read /etc/shells to get available shells, parses the names, filters comments and empty lines, and falls back to a default list if unsuccessful. Returns the list as JSON.
    case "getTerminalTypes": {
      let terminalTypes: string[] = [];
      try {
        // 读取 /etc/shells 文件获取支持的终端类型
        const shells = execSync('cat /etc/shells').toString().split('\n');
        terminalTypes = shells
          .filter((shell) => shell.trim() && !shell.startsWith('#')) // 过滤空行和注释
          .map((shell) => shell.split('/').pop() || ''); // 提取 shell 名称
      } catch (error) {
        // 如果读取失败,返回默认的终端类型
        terminalTypes = ['bash', 'cmd', 'powershell', 'zsh', 'fish', 'sh', 'ksh', 'csh'];
      }
    
      return {
        content: [{
          type: "text",
          text: JSON.stringify({ terminalTypes }, null, 2)
        }]
      };
    }
  • The tool schema definition for 'getTerminalTypes', including name, description, and empty input schema (no parameters required).
    {
      name: "getTerminalTypes",
      description: "获取系统上支持的所有终端类型",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    },
  • src/index.ts:25-282 (registration)
    The handleRequest function returns the list of available tools, registering 'getTerminalTypes' in the MCP listTools response.
    export const handleRequest = async () => {
      return {
        tools: [
          {
            name: "getPlatformInfo",
            description: "获取当前系统的平台信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getMemoryInfo",
            description: "获取当前系统的内存信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getCpuInfo",
            description: "获取当前系统的 CPU 信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getNetworkInfo",
            description: "获取当前系统的网络信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getUserInfo",
            description: "获取当前系统的用户信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getCpuUsage",
            description: "获取当前平台的 CPU 占用率",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getDiskUsage",
            description: "获取当前平台的硬盘使用率",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getTerminalTypes",
            description: "获取系统上支持的所有终端类型",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getIpv4Info",
            description: "获取当前设备的 IPv4 信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getIpv6Info",
            description: "获取当前设备的 IPv6 信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getProxyInfo",
            description: "获取当前网络的所有代理信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getHardwareInfo",
            description: "获取当前设备的硬件信息,包括生产日期等",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getVpnInfo",
            description: "获取当前设备的 VPN 信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getInstalledApps",
            description: "获取当前设备已安装的应用信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getWifiInfo",
            description: "获取当前设备的 Wi-Fi 信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getAppSchemas",
            description: "获取当前设备所有注册唤醒的 App Schema 信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getTimezone",
            description: "获取当前设备的时区信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getAvailableNetworks",
            description: "获取当前设备可用的网络信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getBatteryInfo",
            description: "获取当前设备的电池信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getGraphicsInfo",
            description: "获取当前设备的显卡信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getProcesses",
            description: "获取当前设备的进程信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getBluetoothInfo",
            description: "获取当前设备的蓝牙信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getAudioInfo",
            description: "获取当前设备的音频设备信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getUsbInfo",
            description: "获取当前设备的 USB 设备信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getPrinterInfo",
            description: "获取当前设备的打印机信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getSshPublicKey",
            description: "获取当前用户的 SSH 公钥",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getDockerInfo",
            description: "获取当前设备的 Docker 信息,若未安装则返回空",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          },
          {
            name: "getNodeInfo",
            description: "获取当前设备安装的 Node.js 版本信息",
            inputSchema: {
              type: "object",
              properties: {},
              required: []
            }
          }
        ]
      };
    };
  • src/index.ts:787-790 (registration)
    Server request handlers are set for ListToolsRequestSchema and CallToolRequestSchema, enabling the tool listing and execution including getTerminalTypes.
    server.setRequestHandler(ListToolsRequestSchema, handleRequest);
    
    // 处理工具调用
    server.setRequestHandler(CallToolRequestSchema, handleCallToolRequest);
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 of behavioral disclosure. It only states what the tool does ('获取系统上支持的所有终端类型'), without mentioning whether it's read-only, if it requires permissions, what format the output is in, or any potential side effects. This is a significant gap for a tool with no annotation coverage.

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, clear sentence in Chinese that directly states the tool's purpose without any unnecessary words or fluff. It is front-loaded and efficiently communicates the core functionality.

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?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally complete. It tells the agent what the tool does, but lacks details on output format, behavioral traits, or usage context. For a basic retrieval tool, this is adequate but leaves gaps in understanding how to interpret results.

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 the schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, making it adequate for this case. A baseline of 4 is appropriate as it doesn't introduce confusion about parameters.

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 ('获取' meaning 'get' or 'retrieve') and the resource ('所有终端类型' meaning 'all terminal types'), making the purpose specific and understandable. However, it doesn't explicitly differentiate this tool from its siblings (e.g., getGraphicsInfo, getHardwareInfo), which are also retrieval tools for different system information.

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 any prerequisites, specific contexts, or comparisons with sibling tools, leaving the agent to infer usage based solely on the tool name and description.

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/JackXuyi/env-mcp'

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