Skip to main content
Glama

Current operating environment

getTerminalTypes

Retrieve a list of all supported terminal types on the system to ensure compatibility and configure settings in the current operating environment.

Instructions

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

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "required": [], "type": "object" }

Implementation Reference

  • Handler function for getTerminalTypes tool: reads /etc/shells to list available terminal shells, parses names, falls back to a default list if failed, returns 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) }] }; }
  • src/index.ts:91-99 (registration)
    Tool registration in the listTools array: defines name, description, and empty input schema for getTerminalTypes.
    { name: "getTerminalTypes", description: "获取系统上支持的所有终端类型", inputSchema: { type: "object", properties: {}, required: [] } },
  • Input schema definition: empty object (no parameters required).
    inputSchema: { type: "object", properties: {}, required: [] }

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