mailosaur_servers_delete
Permanently delete a Mailosaur server and erase all messages stored within it.
Instructions
Permanently delete a Mailosaur server and all contained messages.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Server ID. | |
| confirm | No |
Implementation Reference
- src/index.ts:311-323 (registration)Registration of the 'mailosaur_servers_delete' tool via server.tool() with name, description, schema, and handler.
server.tool( "mailosaur_servers_delete", "Permanently delete a Mailosaur server and all contained messages.", { id: z.string().describe("Server ID."), confirm: z.boolean().optional() }, async ({ id, confirm }) => { requireConfirm(confirm, `delete server ${id}`); await mailosaur.servers.del(id); return emptyResponse("Server deleted."); } ); - src/index.ts:318-322 (handler)Handler function that calls requireConfirm() and mailosaur.servers.del(id), then returns emptyResponse.
async ({ id, confirm }) => { requireConfirm(confirm, `delete server ${id}`); await mailosaur.servers.del(id); return emptyResponse("Server deleted."); } - src/index.ts:314-317 (schema)Input schema with 'id' (required string) and 'confirm' (optional boolean) defined using Zod.
{ id: z.string().describe("Server ID."), confirm: z.boolean().optional() }, - src/index.ts:90-92 (helper)Helper function emptyResponse() used to return a simple success response.
function emptyResponse(message = "OK") { return response({ ok: true, message }); } - src/index.ts:94-98 (helper)Helper function requireConfirm() that throws an error if confirm is falsy, used for destructive operations.
function requireConfirm(confirm: boolean | undefined, action: string) { if (!confirm) { throw new Error(`Refusing to ${action}. Call again with confirm: true.`); } }