delete_virtual_key
Delete a virtual key by slug. This irreversible action removes the key and breaks any prompts or configs that reference it, so verify no active dependencies first.
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/services/keys.service.ts:178-181 (handler)The actual service handler that executes the delete logic. Calls this.delete() on /virtual-keys/{slug} via BaseService and returns success.
async deleteVirtualKey(slug: string): Promise<{ success: boolean }> { await this.delete(`/virtual-keys/${this.encodePathSegment(slug)}`); return { success: true }; } - src/tools/keys.tools.ts:386-409 (registration)Registration of the 'delete_virtual_key' tool on the MCP server, with description, schema reference, and handler that calls service.keys.deleteVirtualKey.
// 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 definition for deleteVirtualKey input - requires a 'slug' string parameter.
deleteVirtualKey: { slug: z.string().describe("The slug of the virtual key to delete"), }, - src/services/base.service.ts:53-55 (helper)Helper method encodePathSegment used by deleteVirtualKey to safely encode the slug in the URL path.
protected encodePathSegment(value: string): string { return encodeURIComponent(value); } - src/services/base.service.ts:159-161 (helper)BaseService.delete method that issues the HTTP DELETE request to the API endpoint.
protected async delete<T>(path: string): Promise<T> { return this.executeRequest<T>("DELETE", path, { allowNoContent: true }); }