twining_archive
Archive old blackboard entries by moving them to a file based on timestamp cutoff while preserving decision entries and optionally posting a summary.
Instructions
Archive old blackboard entries. Moves entries older than a cutoff timestamp to an archive file, preserving decision entries. Optionally posts a summary finding.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| before | No | ISO timestamp cutoff — archive entries before this time (default: now) | |
| keep_decisions | No | Whether to keep decision entries in the blackboard (default: true) | |
| summarize | No | Whether to post a summary finding after archiving (default: true) |
Implementation Reference
- src/tools/lifecycle-tools.ts:202-216 (handler)The handler for `twining_archive` which delegates to the `archiver` service.
async (args) => { try { const result = await archiver.archive(args); return toolResult(result); } catch (e) { if (e instanceof TwiningError) { return toolError(e.message, e.code); } return toolError( e instanceof Error ? e.message : "Unknown error", "INTERNAL_ERROR", ); } }, ); - src/tools/lifecycle-tools.ts:184-200 (schema)Zod schema definition for `twining_archive` input parameters.
inputSchema: { before: z .string() .refine((val) => !isNaN(Date.parse(val)), { message: "Must be a valid ISO 8601 timestamp", }) .optional() .describe("ISO timestamp cutoff — archive entries before this time (default: now)"), keep_decisions: z .boolean() .optional() .describe("Whether to keep decision entries in the blackboard (default: true)"), summarize: z .boolean() .optional() .describe("Whether to post a summary finding after archiving (default: true)"), }, - src/tools/lifecycle-tools.ts:178-216 (registration)Registration of `twining_archive` tool in the MCP server.
// twining_archive — Archive old blackboard entries server.registerTool( "twining_archive", { description: "Archive old blackboard entries. Moves entries older than a cutoff timestamp to an archive file, preserving decision entries. Optionally posts a summary finding.", inputSchema: { before: z .string() .refine((val) => !isNaN(Date.parse(val)), { message: "Must be a valid ISO 8601 timestamp", }) .optional() .describe("ISO timestamp cutoff — archive entries before this time (default: now)"), keep_decisions: z .boolean() .optional() .describe("Whether to keep decision entries in the blackboard (default: true)"), summarize: z .boolean() .optional() .describe("Whether to post a summary finding after archiving (default: true)"), }, }, async (args) => { try { const result = await archiver.archive(args); return toolResult(result); } catch (e) { if (e instanceof TwiningError) { return toolError(e.message, e.code); } return toolError( e instanceof Error ? e.message : "Unknown error", "INTERNAL_ERROR", ); } }, );