Skip to main content
Glama

manage_routes

Enable or disable specific CIDR routes for a device using the Tailscale MCP Server, ensuring precise control over network configurations and routing.

Instructions

Enable or disable routes for a device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesWhether to enable or disable the routes
deviceIdYesThe ID of the device
routesYesArray of CIDR routes to manage

Implementation Reference

  • The handler function for the manage_routes tool, which enables or disables specified CIDR routes for a given device using the Tailscale client.
    async function manageRoutes(
      args: z.infer<typeof ManageRoutesSchema>,
      context: ToolContext,
    ): Promise<CallToolResult> {
      try {
        logger.debug("Managing routes:", args);
    
        let result: UnifiedResponse<void>;
        if (args.action === "enable") {
          result = await context.client.enableDeviceRoutes(
            args.deviceId,
            args.routes,
          );
        } else {
          result = await context.client.disableDeviceRoutes(
            args.deviceId,
            args.routes,
          );
        }
    
        if (!result.success) {
          return returnToolError(result.error);
        }
    
        const verbPast = args.action === "enable" ? "enabled" : "disabled";
        return returnToolSuccess(
          `Successfully ${verbPast} routes ${args.routes.join(
            ", ",
          )} for device ${args.deviceId}`,
        );
      } catch (error: unknown) {
        logger.error("Error managing routes:", error);
        return returnToolError(error);
      }
    }
  • Zod input schema for the manage_routes tool defining deviceId, routes array, and action (enable/disable).
    const ManageRoutesSchema = z.object({
      deviceId: z.string().describe("The ID of the device"),
      routes: z.array(z.string()).describe("Array of CIDR routes to manage"),
      action: z
        .enum(["enable", "disable"])
        .describe("Whether to enable or disable the routes"),
    });
  • Tool registration object within the deviceTools module's tools array, linking name, description, schema, and handler.
    {
      name: "manage_routes",
      description: "Enable or disable routes for a device",
      inputSchema: ManageRoutesSchema,
      handler: manageRoutes,
    },
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. While 'enable or disable' implies mutation, it doesn't specify whether this requires admin permissions, if changes are reversible, potential side effects on network connectivity, or error conditions. For a tool that modifies device routing, this leaves critical operational context undocumented.

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 a single, efficient sentence that directly states the tool's function without unnecessary words. It's appropriately sized for a tool with clear parameters and gets straight to the point with zero wasted verbiage.

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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after enabling/disabling routes (e.g., confirmation message, error responses, network impact) or provide context about typical use cases. Given the complexity of network routing changes, more operational guidance would be expected.

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%, with all parameters well-documented in the schema itself. The description adds no additional parameter context beyond what's already in the schema (device ID, routes as CIDR array, action as enable/disable). This meets the baseline for high schema coverage but doesn't provide extra value like format examples or constraints.

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 action ('enable or disable') and resource ('routes for a device'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from siblings like 'manage_acl' or 'manage_device_tags', which also manage device configurations, leaving some ambiguity about scope boundaries.

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 siblings like 'manage_acl' (for access control) and 'device_action' (generic device operations), there's no indication of whether this is for network routing specifically or how it relates to other management tools. No prerequisites or exclusions are mentioned.

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