delete_patterns
Remove multiple stored coding patterns from the MCPatterns database to clean up outdated or unused development conventions.
Instructions
Delete multiple patterns from the database
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patternNames | Yes | An array of pattern names to delete |
Implementation Reference
- src/index.ts:95-99 (handler)The async deletePatterns method in PatternsManager class implements the core logic: loads the database, filters out patterns matching the provided names, and saves the updated database.
async deletePatterns(patternNames: string[]): Promise<void> { const database = await this.loadDatabase(); database.patterns = database.patterns.filter(p => !patternNames.includes(p.name)); await this.saveDatabase(database); } - src/index.ts:221-235 (schema)Tool registration defining the 'delete_patterns' tool with its input schema specifying a required 'patternNames' array of strings to identify which patterns to delete.
{ name: "delete_patterns", description: "Delete multiple patterns from the database", inputSchema: { type: "object", properties: { patternNames: { type: "array", items: { type: "string" }, description: "An array of pattern names to delete" }, }, required: ["patternNames"], }, }, - src/index.ts:311-313 (registration)The request handler switch case for 'delete_patterns' that invokes patternsManager.deletePatterns with the patternNames argument and returns a success message.
case "delete_patterns": await patternsManager.deletePatterns(args.patternNames as string[]); return { content: [{ type: "text", text: "Patterns deleted successfully" }] };