read_patterns
Retrieve stored coding patterns from the MCPatterns database to maintain consistent development styles and conventions across projects.
Instructions
Read all patterns from the database
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "read_patterns"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:114-116 (handler)The readPatterns() method that implements the tool logic - loads and returns the entire patterns database
async readPatterns(): Promise<PatternsDatabase> { return this.loadDatabase(); } - src/index.ts:23-35 (schema)Type definitions for Pattern and PatternsDatabase interfaces that define the structure of pattern data
// We are storing coding patterns with their metadata and code examples interface Pattern { name: string; category: string; description: string; use_cases: string[]; technologies: string[]; code_examples: { [language: string]: string }; } interface PatternsDatabase { patterns: Pattern[]; } - src/index.ts:262-268 (registration)Tool registration defining 'read_patterns' with its name, description, and empty input schema
name: "read_patterns", description: "Read all patterns from the database", inputSchema: { type: "object", properties: {}, }, }, - src/index.ts:317-318 (handler)Request handler case statement that invokes readPatterns() and returns the result as JSON
case "read_patterns": return { content: [{ type: "text", text: JSON.stringify(await patternsManager.readPatterns(), null, 2) }] };