dns_uninstall_app
Uninstall a DNS app from the server by specifying its name and setting confirm to true to execute the removal.
Instructions
Uninstall a DNS app from the server. Requires confirm=true to execute.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the app to uninstall | |
| confirm | No | Must be true to confirm uninstall. Without this, returns a warning instead. |
Implementation Reference
- src/tools/apps.ts:92-109 (handler)The handler function for dns_uninstall_app tool. It validates the app name length, checks for confirm=true (returning a warning if not confirmed), then calls the API endpoint /api/apps/uninstall to uninstall the app.
handler: async (args) => { const name = validateStringLength(args.name as string, 200, "App name"); if (args.confirm !== true) { return JSON.stringify( { warning: `This will uninstall the app '${name}' and remove its data. Set confirm=true to proceed.`, }, null, 2 ); } const data = await client.callOrThrow("/api/apps/uninstall", { name }); return JSON.stringify( { success: true, uninstalled: name, ...data }, null, 2 ); }, - src/tools/apps.ts:71-89 (schema)The input schema for dns_uninstall_app. Defines required 'name' (string) and optional 'confirm' (boolean) parameters. Used for input validation.
definition: { name: "dns_uninstall_app", description: "Uninstall a DNS app from the server. Requires confirm=true to execute.", inputSchema: { type: "object", properties: { name: { type: "string", description: "Name of the app to uninstall", }, confirm: { type: "boolean", description: "Must be true to confirm uninstall. Without this, returns a warning instead.", }, }, required: ["name"], }, - src/tools/apps.ts:5-6 (registration)The appTools() function that returns an array of tool entries, including dns_uninstall_app. This is called from getAllTools() in src/tools/index.ts.
export function appTools(client: TechnitiumClient): ToolEntry[] { return [ - src/tools/index.ts:14-27 (registration)The getAllTools() function that aggregates all tool collections from various modules, including appTools() which contains dns_uninstall_app.
export function getAllTools(client: TechnitiumClient): ToolEntry[] { return [ ...dashboardTools(client), ...dnsClientTools(client), ...zoneTools(client), ...recordTools(client), ...blockingTools(client), ...cacheTools(client), ...settingsTools(client), ...logTools(client), ...appTools(client), ...dnssecTools(client), ]; } - src/validate.ts:91-99 (helper)The validateStringLength helper used by the handler to validate the 'name' parameter length.
export function validateStringLength(value: string, maxLength: number, fieldName: string): string { if (typeof value !== "string") { throw new Error(`${fieldName} must be a string`); } if (value.length > maxLength) { throw new Error(`${fieldName} exceeds maximum length of ${maxLength}`); } return value; }