Skip to main content
Glama

manage_exit_nodes

Control and configure Tailscale exit nodes for routing operations. List, set, clear, advertise, or stop advertising routes like 0.0.0.0/0 or ::/0 using device IDs for precise network management.

Instructions

Manage Tailscale exit nodes and routing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceIdNoDevice ID for exit node operations
operationYesExit node operation to perform
routesYesRoutes to advertise (e.g., ["0.0.0.0/0", "::/0"] for full exit node)

Implementation Reference

  • The main handler function implementing manage_exit_nodes tool logic for listing, advertising, setting, and clearing exit nodes.
    async function manageExitNodes(
      args: z.infer<typeof ExitNodeSchema>,
      context: ToolContext,
    ): Promise<CallToolResult> {
      try {
        logger.debug("Managing exit nodes:", args);
    
        switch (args.operation) {
          case "list": {
            const devicesResult = await context.api.listDevices();
            if (!devicesResult.success) {
              return returnToolError(devicesResult.error);
            }
    
            const devices = devicesResult.data || [];
            const exitNodes = devices.filter(
              (device) =>
                device.advertisedRoutes?.includes("0.0.0.0/0") ||
                device.advertisedRoutes?.includes("::/0"),
            );
    
            if (exitNodes.length === 0) {
              return returnToolSuccess("No exit nodes found in the network");
            }
    
            const exitNodeList = exitNodes
              .map((node) => {
                return `**${node.name}** (${node.hostname})
      - ID: ${node.id}
      - OS: ${node.os}
      - Routes: ${node.advertisedRoutes?.join(", ") || "None"}
      - Status: ${node.authorized ? "Authorized" : "Unauthorized"}`;
              })
              .join("\n\n");
    
            return returnToolSuccess(
              `Exit Nodes (${exitNodes.length}):\n\n${exitNodeList}`,
            );
          }
    
          case "advertise": {
            if (!args.deviceId || !args.routes) {
              return returnToolError(
                "Device ID and routes are required for advertise operation",
              );
            }
    
            const result = await context.api.setDeviceExitNode(
              args.deviceId,
              args.routes,
            );
            if (!result.success) {
              return returnToolError(result.error);
            }
    
            return returnToolSuccess(
              `Device ${
                args.deviceId
              } is now advertising routes: ${args.routes.join(", ")}`,
            );
          }
    
          case "set": {
            const nodeId = args.deviceId ?? "";
            const cliResult = await context.cli.setExitNode(nodeId);
            if (!cliResult.success) {
              return returnToolError(cliResult.error);
            }
    
            return returnToolSuccess(
              `Exit node set to: ${args.deviceId || "auto"}`,
            );
          }
    
          case "clear": {
            const cliResult = await context.cli.setExitNode();
            if (!cliResult.success) {
              return returnToolError(cliResult.error);
            }
    
            return returnToolSuccess("Exit node cleared successfully");
          }
    
          default:
            return returnToolError(
              "Invalid exit node operation. Use: list, set, clear, advertise",
            );
        }
      } catch (error) {
        logger.error("Error managing exit nodes:", error);
        return returnToolError(error);
      }
    }
  • Zod input schema defining parameters for the manage_exit_nodes tool (operation, deviceId, routes).
    const ExitNodeSchema = z.object({
      operation: z
        .enum(["list", "set", "clear", "advertise", "stop_advertising"])
        .describe("Exit node operation to perform"),
      deviceId: z
        .string()
        .optional()
        .describe("Device ID for exit node operations"),
      routes: z
        .array(z.string())
        .min(1, "At least one route must be specified")
        .describe(
          'Routes to advertise (e.g., ["0.0.0.0/0", "::/0"] for full exit node)',
        ),
    });
  • Registration of the manage_exit_nodes tool in the adminTools ToolModule, linking name, schema, and handler.
    {
      name: "manage_exit_nodes",
      description: "Manage Tailscale exit nodes and routing",
      inputSchema: ExitNodeSchema,
      handler: manageExitNodes,
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Manage' implies both read and write operations, but it doesn't specify permissions required, side effects, or what happens during operations like 'set' or 'clear'. It mentions 'exit nodes and routing' but gives no insight into rate limits, authentication needs, or system impact. The description is too generic to adequately inform behavioral expectations.

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 extremely concise—just five words—with zero wasted language. It's front-loaded with the core concept ('Manage Tailscale exit nodes and routing') and contains no unnecessary elaboration. This efficiency makes it easy to parse, though it may be too brief for complete understanding.

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

Completeness2/5

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

Given the tool's complexity (multiple operations including destructive actions like 'set' and 'clear'), lack of annotations, and no output schema, the description is insufficiently complete. It doesn't explain what the tool returns, error conditions, or operational consequences. For a tool with potentially significant network impact, more context about behavior and outcomes is needed beyond the bare statement provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all three parameters (deviceId, operation, routes). The description adds no additional parameter semantics beyond what's in the schema—it doesn't explain parameter relationships, provide examples beyond the schema's route example, or clarify when deviceId is needed. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but doesn't detract either.

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

Purpose3/5

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

The description 'Manage Tailscale exit nodes and routing' states the general domain (exit nodes and routing) but lacks specificity about what 'manage' entails. It doesn't distinguish this tool from sibling tools like 'manage_routes' or 'manage_acl', leaving the exact verb and resource scope vague. However, it does identify the correct technology context (Tailscale).

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. With sibling tools like 'manage_routes', 'device_action', and 'list_devices', there's no indication of how this tool differs or when it should be preferred. The description offers only a generic statement without context for tool selection.

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

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/HexSleeves/tailscale-mcp'

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