disconnect_network
Terminates active connection to the Tailscale network using a standardized command, enabling automated network disconnection through the Tailscale MCP Server.
Instructions
Disconnect from the Tailscale network
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/network-tools.ts:156-177 (handler)The primary handler function for the 'disconnect_network' tool. It invokes context.client.disconnect() to disconnect from the Tailscale network, logs the action, and returns a success or error result.async function disconnectNetwork( _args: Record<string, unknown>, context: ToolContext, ): Promise<CallToolResult> { try { logger.debug("Disconnecting from Tailscale network"); // Use unified client - this operation is CLI-only const result = await context.client.disconnect(); if (!result.success) { return returnToolError(result.error); } return returnToolSuccess( `Successfully disconnected from Tailscale network\n\n${result.data}`, ); } catch (error: unknown) { logger.error("Error disconnecting from network:", error); return returnToolError(error); } }
- src/tools/network-tools.ts:240-245 (registration)Local registration of the 'disconnect_network' tool within the networkTools ToolModule export. Defines the tool name, description, empty input schema (no parameters), and references the handler function.{ name: "disconnect_network", description: "Disconnect from the Tailscale network", inputSchema: z.object({}), handler: disconnectNetwork, },
- src/tools/index.ts:11-11 (registration)Import of the networkTools module (containing disconnect_network tool) into the central ToolRegistry.import { networkTools } from "./network-tools.js";
- src/tools/index.ts:43-47 (registration)Top-level registration of the networkTools module in the ToolRegistry's loadTools() method, which registers all tools including 'disconnect_network'.this.registerModule(deviceTools); this.registerModule(networkTools); this.registerModule(aclTools); this.registerModule(adminTools);