Archive Campaign Group
archive_campaign_groupSoft-delete a campaign group and every campaign within it. Prevents archiving the default group; move campaigns out first.
Instructions
Soft-delete the group AND every campaign in it. The default group cannot be archived; ask the user to move campaigns out first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group_id | Yes | Campaign group UUID. |
Implementation Reference
- The tool definition (name, description, annotations, inputSchema) and the handler that calls ctx.api.archiveCampaignGroup(input.group_id) to soft-delete the group and all its campaigns.
export const archiveCampaignGroupTool: Tool< ArchiveCampaignGroupInputShape, ArchiveCampaignGroupOutput > = { name: "archive_campaign_group", description: "Soft-delete the group AND every campaign in it. The default group cannot be archived; ask the user to move campaigns out first.", annotations: { title: "Archive Campaign Group", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, inputSchema: z.object(ArchiveCampaignGroupInputShape), handler: async (input, ctx): Promise<Result<ArchiveCampaignGroupOutput, ToolError>> => { const result = await ctx.api.archiveCampaignGroup(input.group_id); if (result.isErr()) return err(mapApiError(result.error)); return ok(result.value); }, }; - Input schema: expects a UUID 'group_id' field. Output type is 'GroupActionResponse'.
const ArchiveCampaignGroupInputShape = { group_id: z.string().uuid().describe("Campaign group UUID."), } as const; type ArchiveCampaignGroupInputShape = typeof ArchiveCampaignGroupInputShape; - src/application/tool-registry.ts:149-150 (registration)Tool registered in the tool registry via register(archiveCampaignGroupTool).
register(archiveCampaignGroupTool); register(unarchiveCampaignGroupTool); - Production HTTP gateway: sends POST to /api/v1/campaign-groups/{group_id}/archive.
async archiveCampaignGroup(id: string): Promise<Result<GroupActionResponse, ApiError>> { return call( "POST", "/api/v1/campaign-groups/{group_id}/archive", { params: { path: { group_id: id } } }, parseGroupAction ); }, - Fake/test gateway: records the call and returns a default GroupActionResponse.
async archiveCampaignGroup(id) { push({ method: "archiveCampaignGroup", id }); await Promise.resolve(); return ( state.responses.archiveCampaignGroup ?? ok<GroupActionResponse, ApiError>(DEFAULT_GROUP_ACTION) ); },