open_patterns
Retrieve personalized coding patterns by name to maintain consistent development styles and conventions across projects.
Instructions
Open specific patterns by their names
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| names | Yes | An array of pattern names to retrieve |
Implementation Reference
- src/index.ts:135-141 (handler)The openPatterns method in PatternsManager class - the core handler that loads the database and filters patterns by name to return matching patterns.
async openPatterns(names: string[]): Promise<PatternsDatabase> { const database = await this.loadDatabase(); const filteredPatterns = database.patterns.filter(p => names.includes(p.name)); return { patterns: filteredPatterns }; } - src/index.ts:281-294 (schema)Tool registration schema defining 'open_patterns' with its inputSchema specifying a required 'names' array parameter for pattern names to retrieve.
name: "open_patterns", description: "Open specific patterns by their names", inputSchema: { type: "object", properties: { names: { type: "array", items: { type: "string" }, description: "An array of pattern names to retrieve", }, }, required: ["names"], }, }, - src/index.ts:321-322 (registration)Switch case handler that routes 'open_patterns' tool calls to the patternsManager.openPatterns method with the names argument.
case "open_patterns": return { content: [{ type: "text", text: JSON.stringify(await patternsManager.openPatterns(args.names as string[]), null, 2) }] }; - src/index.ts:24-35 (schema)Type definitions for Pattern and PatternsDatabase interfaces that define the data structure used by the open_patterns tool.
interface Pattern { name: string; category: string; description: string; use_cases: string[]; technologies: string[]; code_examples: { [language: string]: string }; } interface PatternsDatabase { patterns: Pattern[]; }