Skip to main content
Glama
aiopnet

MCP Nautobot Server

by aiopnet

test_connection

Verify connectivity to the Nautobot API for network automation and infrastructure data access.

Instructions

Test the connection to the Nautobot API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'test_connection': calls NautobotClient.test_connection(), formats the result with connection status, URL, and timestamp, and returns it as formatted text content.
    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 MCP server's list_tools() method, defining its name, description, and empty input schema.
    types.Tool( name="test_connection", description="Test the connection to the Nautobot API", inputSchema={ "type": "object", "properties": {}, "additionalProperties": False }, ),
  • Core helper method in NautobotClient that tests the API connection by making a GET request to the Nautobot /status/ endpoint and returns True on success or False on failure.
    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

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