Skip to main content
Glama
aiopnet

MCP Nautobot Server

by aiopnet

test_connection

Verify connectivity to the Nautobot API by executing a test through the MCP Nautobot Server, ensuring seamless integration with network automation and source of truth systems.

Instructions

Test the connection to the Nautobot API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler for the 'test_connection' tool within the handle_call_tool function. It tests the connection using the NautobotClient and returns a formatted result.
    elif name == "test_connection": logger.info("Testing Nautobot API connection") # Test connection is_connected = await client.test_connection() result = { "connected": is_connected, "nautobot_url": client.base_url, "timestamp": str(asyncio.get_event_loop().time()) } status_text = "✅ Connected" if is_connected else "❌ Connection Failed" return [ types.TextContent( type="text", text=f"Nautobot API Connection Test: {status_text}\n\n" f"```json\n{result}\n```" ) ]
  • Registration of the 'test_connection' tool in the list_tools handler, including its name, description, and input schema.
    types.Tool( name="test_connection", description="Test the connection to the Nautobot API", inputSchema={ "type": "object", "properties": {}, "additionalProperties": False }, ),
  • The NautobotClient.test_connection() helper method that performs the actual API connection test by requesting the /status/ endpoint.
    async def test_connection(self) -> bool: """ Test the connection to Nautobot API. Returns: True if connection successful, False otherwise """ try: await self._make_request("GET", "/status/") logger.info("Successfully connected to Nautobot API") return True except Exception as e: logger.error(f"Failed to connect to Nautobot API: {e}") return False

Other Tools

Related 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/aiopnet/mcp-nautobot'

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