Skip to main content
Glama
arjshiv

Local Utilities MCP Server

by arjshiv

get_public_ip

Retrieve the public IP address of the machine hosting the MCP server for network configuration and connectivity verification.

Instructions

Returns the public IP address of the machine running the MCP server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The asynchronous handler function for the 'get_public_ip' tool. It fetches the public IP using the helper function and returns it in MCP text content format.
    async () => {
      const publicIp = await getPublicIp();
      return {
        content: [{
          type: "text",
          text: publicIp
        }]
      };
    }
  • Core helper function that fetches the machine's public IP address via HTTPS request to api.ipify.org.
    export async function getPublicIp(): Promise<string> {
      return new Promise((resolve, reject) => {
        https.get('https://api.ipify.org', (res) => {
          let data = '';
          res.on('data', (chunk) => {
            data += chunk;
          });
          res.on('end', () => {
            resolve(data.trim());
          });
        }).on('error', (err) => {
          console.error("Error fetching public IP from api.ipify.org:", err);
          reject(new Error("Failed to fetch public IP address"));
        });
      });
    }
  • Function that registers the 'get_public_ip' tool on the MCP server by calling server.tool with name, description, and handler.
    export function registerPublicIpTool(server: McpServer): void {
      server.tool(
        "get_public_ip",
        "Returns the public IP address of the machine running the MCP server.",
        async () => {
          const publicIp = await getPublicIp();
          return {
            content: [{
              type: "text",
              text: publicIp
            }]
          };
        }
      );
    } 
  • src/index.ts:20-20 (registration)
    Top-level call to registerPublicIpTool during server setup, which registers the get_public_ip tool.
    registerPublicIpTool(server);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the tool's behavior as a read-only operation that returns IP information, but lacks details on potential errors, network dependencies, or response format. It's adequate but misses richer behavioral context.

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, efficient sentence that directly states the tool's function with no wasted words. It's front-loaded and appropriately sized for a simple tool, making it easy for an agent to parse quickly.

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 simple tool with no parameters, no output schema, and no annotations, the description is minimally complete. It explains what the tool does but lacks details on return format or error handling, which could be helpful given the absence of structured output information.

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 no parameter documentation is needed. The description appropriately focuses on the tool's purpose without redundant parameter details, aligning with the baseline for zero-parameter tools.

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

Purpose5/5

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

The description clearly states the specific action ('Returns') and resource ('public IP address of the machine running the MCP server'), distinguishing it from siblings like get_hostname or get_node_version. It precisely defines what the tool does without ambiguity.

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?

No guidance is provided on when to use this tool versus alternatives. While the purpose is clear, there's no mention of specific use cases, prerequisites, or comparisons to sibling tools like get_hostname, leaving the agent to infer usage context.

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/arjshiv/localutils-mcp-server'

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