delete_canvas
Delete an Instant Experience (Canvas) by providing its ID. This action is permanent and irreversible.
Instructions
Delete an Instant Experience (Canvas). This action is irreversible.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| canvas_id | Yes | Canvas ID to delete |
Implementation Reference
- src/tools/canvas.ts:71-85 (handler)The delete_canvas tool handler function. Calls client.delete with the canvas_id and returns success response, or catches errors.
server.tool( "delete_canvas", "Delete an Instant Experience (Canvas). This action is irreversible.", { canvas_id: z.string().describe("Canvas ID to delete"), }, async ({ canvas_id }) => { try { const { data, rateLimit } = await client.delete(`/${canvas_id}`); return { content: [{ type: "text" as const, text: JSON.stringify({ success: true, ...data as object, _rateLimit: rateLimit }, null, 2) }] }; } catch (error) { return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } ); - src/tools/canvas.ts:74-76 (schema)Input schema for delete_canvas: requires canvas_id (string).
{ canvas_id: z.string().describe("Canvas ID to delete"), }, - src/tools/canvas.ts:5-5 (registration)The registerCanvasTools function is exported and registers canvas tools on the server.
export function registerCanvasTools(server: McpServer, client: AdsClient): void { - src/index.ts:58-58 (registration)Where registerCanvasTools is called to register the tool on the MCP server.
registerCanvasTools(server, client); - src/services/ads-client.ts:194-199 (helper)The client.delete method used by the handler to perform the HTTP DELETE request.
async delete( path: string, params?: Record<string, unknown> ): Promise<ClientResponse> { return this.request("DELETE", path, params); }