Skip to main content
Glama

manage_dns

Configure and manage Tailscale DNS settings, including nameservers, search paths, and MagicDNS preferences, via the MCP server for streamlined network administration.

Instructions

Manage Tailscale DNS configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
magicDNSNoEnable/disable MagicDNS (for set_preferences operation)
nameserversNoDNS nameservers (for set_nameservers operation)
operationYesDNS operation to perform
searchPathsNoDNS search paths (for set_searchpaths operation)

Implementation Reference

  • The main handler function for the 'manage_dns' tool that handles DNS operations such as getting/setting nameservers, preferences, and search paths using Tailscale API.
    async function manageDNS(
      args: z.infer<typeof DNSSchema>,
      context: ToolContext,
    ): Promise<CallToolResult> {
      try {
        logger.debug("Managing DNS configuration:", args);
    
        switch (args.operation) {
          case "get_nameservers": {
            const result = await context.api.getDNSNameservers();
            if (!result.success) {
              return returnToolError(result.error);
            }
    
            const nameservers = result.data?.dns || [];
            return returnToolSuccess(
              `DNS Nameservers:\n${
                nameservers.length > 0
                  ? nameservers.map((ns) => `  - ${ns}`).join("\n")
                  : "  No custom nameservers configured"
              }`,
            );
          }
    
          case "set_nameservers": {
            if (!args.nameservers) {
              return returnToolError(
                "Nameservers array is required for set_nameservers operation",
              );
            }
    
            const result = await context.api.setDNSNameservers(args.nameservers);
            if (!result.success) {
              return returnToolError(result.error);
            }
    
            return returnToolSuccess(
              `DNS nameservers updated to: ${args.nameservers.join(", ")}`,
            );
          }
    
          case "get_preferences": {
            const result = await context.api.getDNSPreferences();
            if (!result.success) {
              return returnToolError(result.error);
            }
    
            return returnToolSuccess(
              `DNS Preferences:\n  MagicDNS: ${
                result.data?.magicDNS ? "Enabled" : "Disabled"
              }`,
            );
          }
    
          case "set_preferences": {
            if (args.magicDNS === undefined) {
              return returnToolError(
                "magicDNS boolean is required for set_preferences operation",
              );
            }
    
            const result = await context.api.setDNSPreferences(args.magicDNS);
            if (!result.success) {
              return returnToolError(result.error);
            }
    
            return returnToolSuccess(
              `MagicDNS ${args.magicDNS ? "enabled" : "disabled"}`,
            );
          }
    
          case "get_searchpaths": {
            const result = await context.api.getDNSSearchPaths();
            if (!result.success) {
              return returnToolError(result.error);
            }
    
            const searchPaths = result.data?.searchPaths || [];
            return returnToolSuccess(
              `DNS Search Paths:\n${
                searchPaths.length > 0
                  ? searchPaths.map((path) => `  - ${path}`).join("\n")
                  : "  No search paths configured"
              }`,
            );
          }
    
          case "set_searchpaths": {
            if (!args.searchPaths) {
              return returnToolError(
                "searchPaths array is required for set_searchpaths operation",
              );
            }
    
            const result = await context.api.setDNSSearchPaths(args.searchPaths);
            if (!result.success) {
              return returnToolError(result.error);
            }
    
            return returnToolSuccess(
              `DNS search paths updated to: ${args.searchPaths.join(", ")}`,
            );
          }
    
          default:
            return returnToolError(
              "Invalid DNS operation. Use: get_nameservers, set_nameservers, get_preferences, set_preferences, get_searchpaths, set_searchpaths",
            );
        }
      } catch (error: unknown) {
        logger.error("Error managing DNS:", error);
        return returnToolError(error);
      }
    }
  • Zod input schema for the manage_dns tool defining the operation and optional parameters for nameservers, magicDNS, and search paths.
    const DNSSchema = z.object({
      operation: z
        .enum([
          "get_nameservers",
          "set_nameservers",
          "get_preferences",
          "set_preferences",
          "get_searchpaths",
          "set_searchpaths",
        ])
        .describe("DNS operation to perform"),
      nameservers: z
        .array(z.string())
        .optional()
        .describe("DNS nameservers (for set_nameservers operation)"),
      magicDNS: z
        .boolean()
        .optional()
        .describe("Enable/disable MagicDNS (for set_preferences operation)"),
      searchPaths: z
        .array(z.string())
        .optional()
        .describe("DNS search paths (for set_searchpaths operation)"),
    });
  • Registration of the manage_dns tool within the aclTools module, specifying name, description, input schema, and handler function.
    {
      name: "manage_dns",
      description: "Manage Tailscale DNS configuration",
      inputSchema: DNSSchema,
      handler: manageDNS,
    },
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 needed, side effects, rate limits, or response format. For a tool with multiple mutation operations, this is a significant gap in transparency.

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 with zero wasted words. It's appropriately sized for a tool name that suggests its domain, though it could be more informative given the tool's complexity.

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 tool with 4 parameters, multiple mutation operations, no annotations, and no output schema, the description is inadequate. It doesn't explain the tool's scope, behavioral traits, or return values, leaving significant gaps for the agent to navigate this complex configuration tool.

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 parameters. The description adds no additional parameter semantics beyond what's in the schema descriptions (e.g., which parameters correspond to which operations). This meets the baseline for high schema coverage.

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 DNS configuration' states the general purpose (managing DNS configuration) but is vague about what specific operations are available. It doesn't distinguish this tool from potential DNS-related siblings (though none are listed), and the verb 'manage' is broad rather than specific.

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. It doesn't mention prerequisites, context, or exclusions, leaving the agent to infer usage from the operation parameter alone without any directional advice.

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