Skip to main content
Glama

Current operating environment

getIpv4Info

Retrieve IPv4 details of the current device operating environment using this tool. Obtain essential network information to assess and manage connectivity.

Instructions

获取当前设备的 IPv4 信息

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

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

Implementation Reference

  • Handler for the 'getIpv4Info' tool. Filters network interfaces to extract IPv4 addresses, netmasks, and other details per interface, then returns as JSON.
    case "getIpv4Info": { const networkInterfaces = os.networkInterfaces(); const ipInfo: Record<string, { address: string; netmask: string; family: string; internal: boolean }[]> = {}; for (const [interfaceName, interfaces = []] of Object.entries(networkInterfaces)) { const ipv4Interfaces = interfaces .filter((info) => info.family === 'IPv4') .map((info) => ({ address: info.address, netmask: info.netmask, family: info.family, internal: info.internal })); if (ipv4Interfaces.length > 0) { ipInfo[interfaceName] = ipv4Interfaces; } } return { content: [{ type: "text", text: JSON.stringify(ipInfo, null, 2) }] };
  • src/index.ts:100-107 (registration)
    Tool registration entry in the listTools response, defining name, description, and input schema (empty object, no parameters).
    { name: "getIpv4Info", description: "获取当前设备的 IPv4 信息", inputSchema: { type: "object", properties: {}, required: [] }
  • Input schema for getIpv4Info tool, which expects no parameters.
    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