Skip to main content
Glama
archive.ts1.25 kB
/** * Archive 类工具 * 归档已完成的变更 */ import { z } from 'zod'; import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { OpenSpecCli } from '../../core/openspec-cli.js'; export function registerArchiveTools(server: McpServer, cli: OpenSpecCli): void { /** * 归档变更 */ server.tool( 'openspec_archive_change', 'Archive a completed change proposal', { changeId: z.string().describe('Change ID to archive'), skipSpecs: z .boolean() .optional() .describe('Skip merging delta specs into main specs'), }, async ({ changeId, skipSpecs }) => { const result = await cli.archiveChange(changeId, { skipSpecs }); if (result.success) { return { content: [ { type: 'text', text: `✅ Successfully archived change: ${changeId}\n\nArchived to: ${result.archivedPath}`, }, ], }; } else { return { content: [ { type: 'text', text: `❌ Failed to archive change: ${changeId}\n\nError: ${result.error}`, }, ], isError: true, }; } } ); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Lumiaqian/openspec-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server