get_version
Retrieve Tailscale version details using the standardized Model Context Protocol interface to support automated network management and monitoring tasks.
Instructions
Get Tailscale version information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/network-tools.ts:202-223 (handler)The handler function for the 'get_version' tool. It invokes the unified Tailscale client's getVersion method and formats the result as a success response.async function getVersion( _args: Record<string, unknown>, context: ToolContext, ): Promise<CallToolResult> { try { logger.debug("Getting Tailscale version"); // Use unified client - this operation is CLI-only const result = await context.client.getVersion(); if (!result.success) { return returnToolError(result.error); } return returnToolSuccess( `Tailscale version information:\n\n${result.data}`, ); } catch (error: unknown) { logger.error("Error getting version:", error); return returnToolError(error); } }
- src/tools/network-tools.ts:252-257 (registration)The registration of the 'get_version' tool within the networkTools module, including empty input schema and reference to the handler.{ name: "get_version", description: "Get Tailscale version information", inputSchema: z.object({}), handler: getVersion, },
- Supporting method in UnifiedTailscaleClient that delegates to either Tailscale API or CLI to retrieve version information, used by the tool handler.async getVersion(): Promise< UnifiedResponse<string | { version: string; apiVersion: string }> > { if (this.shouldUseAPI("getVersion")) { const response = await this.api.getVersion(); return this.normalizeAPIResponse(response); } if (!this.cliAvailable) { return { success: false, error: "Version information is not available", source: "cli", }; } const response = await this.cli.version(); return this.normalizeCLIResponse(response); }
- Tailscale API client method for fetching version information via HTTP GET to /api/v2/version, called by unified client if API preferred.async getDevice( deviceId: string, ): Promise<TailscaleAPIResponse<TailscaleDevice>> { try { const response = await this.client.get(`/device/${deviceId}`); const device = TailscaleDeviceSchema.parse(response.data); return this.handleResponse({ ...response, data: device }); } catch (error) {