delete_virtual_key
Delete a virtual key by its slug, removing it permanently. Confirm no active dependencies to avoid breaking prompts or configs.
Instructions
Delete a virtual key by slug. This is irreversible and will break prompts and configs that reference the slug, so confirm no active dependencies first. Returns success after removal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | The slug of the virtual key to delete |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |
Implementation Reference
- src/tools/keys.tools.ts:386-409 (registration)Registration of the 'delete_virtual_key' MCP tool with its description, schema reference, and handler logic that calls the service method.
// Phase 2: Delete virtual key tool server.tool( "delete_virtual_key", "Delete a virtual key by slug. This is irreversible and will break prompts and configs that reference the slug, so confirm no active dependencies first. Returns success after removal.", KEYS_TOOL_SCHEMAS.deleteVirtualKey, async (params) => { const result = await service.keys.deleteVirtualKey(params.slug); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully deleted virtual key "${params.slug}"`, success: result.success, }, null, 2, ), }, ], }; }, ); - src/tools/keys.tools.ts:82-84 (schema)Zod schema for the delete_virtual_key tool input: requires 'slug' string.
deleteVirtualKey: { slug: z.string().describe("The slug of the virtual key to delete"), }, - src/services/keys.service.ts:178-181 (handler)Service method deleteVirtualKey that sends a DELETE request to /virtual-keys/{slug} and returns { success: true }.
async deleteVirtualKey(slug: string): Promise<{ success: boolean }> { await this.delete(`/virtual-keys/${this.encodePathSegment(slug)}`); return { success: true }; } - src/services/base.service.ts:159-161 (helper)BaseService.delete helper used by deleteVirtualKey. Sends an HTTP DELETE with allowNoContent: true (handles 204 No Content).
protected async delete<T>(path: string): Promise<T> { return this.executeRequest<T>("DELETE", path, { allowNoContent: true }); }