Skip to main content
Glama
saidsef

GitHub PR Issue Analyser

by saidsef

get_ipv6_info

Retrieve IPv6 network information from API endpoints by temporarily overriding connection settings to force IPv6 usage for network requests.

Instructions

Retrieves IPv6 information from a specified API endpoint. This method temporarily overrides the allowed_gai_family method to force the use of IPv6 when making network requests. It then attempts to fetch IPv6-related information from the configured API URL. Returns: dict: A dictionary containing IPv6 information if the request is successful. Returns an empty dictionary if no information is found or if an error occurs. Error Handling: Logs an error message and returns an empty dictionary if a requests.RequestException is raised during the fetch operation. Also logs the full traceback at the debug level for troubleshooting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function that implements the core logic of the 'get_ipv6_info' tool. It forces IPv6 resolution and fetches IP information from the configured API endpoint (default: https://v6.ipinfo.io/json), handling errors gracefully.
    def get_ipv6_info(self) -> Dict[str, Any]:
      """
      Retrieves IPv6 information from a specified API endpoint.
      This method temporarily overrides the `allowed_gai_family` method to force the use of IPv6 when making network requests.
      It then attempts to fetch IPv6-related information from the configured API URL.
      Returns:
          dict: A dictionary containing IPv6 information if the request is successful.
                Returns an empty dictionary if no information is found or if an error occurs.
      Error Handling:
          Logs an error message and returns an empty dictionary if a `requests.RequestException` is raised during the fetch operation.
          Also logs the full traceback at the debug level for troubleshooting.
      """
      try:
          urllib3_connection.allowed_gai_family = lambda: socket.AF_INET6
          ipv6 = self.get_info(self.ipv6_api_url)
          if not ipv6:
              logging.error("No IPv6 information found.")
              return {"error": "No IPv6 information found."}
          return ipv6
      except requests.RequestException as e:
          logging.error(f"Error fetching IPv6 info: {e}")
          logging.debug(e)
          traceback.print_exc()
          return {"error": f"Failed to fetch IPv6 information: {str(e)}"}
  • The registration code that dynamically discovers and registers all public methods of the IPIntegration instance (including 'get_ipv6_info') as MCP tools via FastMCP.add_tool().
    def _register_tools(self):
        self.register_tools(self.gi)
        self.register_tools(self.ip)
    
    def register_tools(self, methods: Any = None) -> None:
        for name, method in inspect.getmembers(methods):
            if (inspect.isfunction(method) or inspect.ismethod(method)) and not name.startswith("_"):
                self.mcp.add_tool(method)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it temporarily overrides network settings to force IPv6 usage, returns a dictionary or empty dict on success/failure, and handles errors by logging and returning empty dicts. This covers mutation (network override), output format, and error handling, though it could detail more about the override's scope or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized. It starts with the core purpose, explains the internal mechanism, details return values, and covers error handling in separate sections. Each sentence adds necessary information without fluff, though the error handling details could be slightly condensed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 0 parameters, no annotations, and an output schema exists, the description is quite complete. It explains the tool's purpose, internal behavior, return values, and error handling. The output schema likely covers the dictionary structure, so the description needn't detail return values further. It could improve by addressing sibling differentiation or more on the network override's implications.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing instead on the tool's behavior and output. It adds value by explaining the tool's internal mechanism and return semantics without redundancy.

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 tool's purpose: 'Retrieves IPv6 information from a specified API endpoint.' It specifies the verb ('retrieves'), resource ('IPv6 information'), and source ('API endpoint'). However, it doesn't explicitly differentiate from its sibling tool 'get_ipv4_info' beyond the IPv6 focus, missing an opportunity for clearer sibling distinction.

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 the sibling 'get_ipv4_info' or other network-related tools, nor does it specify prerequisites, contexts, or exclusions for usage. The agent receives no help in choosing between this and other tools.

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/saidsef/mcp-github-pr-issue-analyser'

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