get_guidelines
Retrieve coding guidelines for WordPress projects, including security rules and validation patterns, filtered by specific categories to ensure adherence to development standards.
Instructions
Get development guidelines from the configured source
Input Schema
TableJSON 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 main handler function for the 'get_guidelines' tool. It fetches guidelines from the source using the optional category parameter and returns the content in the MCP format.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:11-19 (schema)Input schema definition for the 'get_guidelines' tool, specifying an optional 'category' string parameter.inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Optional category of guidelines to retrieve (e.g., security-rules, validation-rules)', }, }, },
- src/guidelines-manager.ts:8-20 (registration)Tool registration in getTools() method, including name, description, and schema.{ 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)MCP server registration for ListToolsRequestSchema, which exposes the tools including 'get_guidelines'.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: guidelinesManager.getTools(), }; });
- src/index.ts:54-57 (registration)MCP server registration for CallToolRequestSchema, which dispatches to handleTool for execution of 'get_guidelines'.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; return await guidelinesManager.handleTool(name, args); });