get_guidelines
Retrieve coding guidelines, security rules, and validation patterns from external sources to maintain code quality standards in WordPress projects.
Instructions
Get development guidelines from the configured source
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Optional category of guidelines to retrieve (e.g., security-rules, validation-rules) |
Implementation Reference
- src/guidelines-manager.ts:123-138 (handler)The core handler function that executes the get_guidelines tool logic: fetches guidelines from the source using the provided category and returns formatted text content.
private async getGuidelines(category?: string) { try { const content = await this.guidelineSource.fetchGuidelines(category); return { content: [ { type: 'text', text: content, }, ], }; } catch (error) { throw new Error(`Failed to fetch guidelines: ${error instanceof Error ? error.message : 'Unknown error'}`); } } - src/guidelines-manager.ts:8-20 (schema)Defines the input schema and metadata for the get_guidelines tool, including optional 'category' parameter.
{ name: 'get_guidelines', description: 'Get development guidelines from the configured source', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Optional category of guidelines to retrieve (e.g., security-rules, validation-rules)', }, }, }, }, - src/index.ts:48-52 (registration)Registers the handler for listing tools, which includes the get_guidelines tool definition and schema.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: guidelinesManager.getTools(), }; }); - src/index.ts:54-57 (registration)Registers the generic tool call handler that dispatches get_guidelines calls to GuidelinesManager.handleTool.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; return await guidelinesManager.handleTool(name, args); }); - src/guidelines-manager.ts:83-84 (handler)Dispatch case in handleTool method that routes get_guidelines calls to the specific handler.
case 'get_guidelines': return await this.getGuidelines(args.category);