Skip to main content
Glama
JackXuyi

Current operating environment

getIpv4Info

Retrieve IPv4 address details for the current device to identify network configuration and connectivity status.

Instructions

获取当前设备的 IPv4 信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler implementation for getIpv4Info tool that retrieves IPv4 addresses from network interfaces using os.networkInterfaces(), filters for IPv4, and returns structured 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)
        }]
      };
    }
  • Tool schema definition including name, description, and empty input schema for getIpv4Info in the tools list.
    {
      name: "getIpv4Info",
      description: "获取当前设备的 IPv4 信息",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    },
  • src/index.ts:790-790 (registration)
    Registration of the general tool call handler (handleCallToolRequest) which contains the switch case for getIpv4Info.
    server.setRequestHandler(CallToolRequestSchema, handleCallToolRequest);
  • src/index.ts:787-787 (registration)
    Registration of the list tools handler which includes the schema for getIpv4Info.
    server.setRequestHandler(ListToolsRequestSchema, handleRequest);
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 it gets IPv4 information but doesn't specify what information is returned (e.g., address, subnet, gateway), whether it requires network permissions, or if it's read-only (implied but not explicit). The description is too vague about the tool's behavior.

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 function without any fluff or redundant information. It's perfectly front-loaded and wastes no words.

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 is minimally adequate but incomplete. It identifies the resource (IPv4 information) but doesn't specify what information is returned or any behavioral constraints, leaving gaps for the agent to understand the tool fully.

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 fully documents the lack of inputs. The description appropriately doesn't discuss parameters, maintaining focus on the tool's purpose without unnecessary detail.

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') and resource ('IPv4 信息' meaning 'IPv4 information'), making the purpose immediately understandable. It distinguishes from siblings like getIpv6Info by specifying IPv4, but doesn't fully differentiate from broader tools like getNetworkInfo that might include IPv4 data.

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 like getNetworkInfo or getIpv6Info. It simply states what it does without indicating specific use cases, prerequisites, or exclusions.

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