Skip to main content
Glama
miniOrangeDev

WordPress Code Review MCP Server

get_guidelines

Retrieve coding guidelines, security rules, and validation patterns from a configured source to maintain code quality standards in WordPress projects.

Instructions

Get development guidelines from the configured source

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoOptional category of guidelines to retrieve (e.g., security-rules, validation-rules)

Implementation Reference

  • The private async method getGuidelines() that implements the core logic for the 'get_guidelines' tool. It accepts an optional category parameter, delegates to guidelineSource.fetchGuidelines(), and returns a formatted response with the 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'}`);
      }
    }
  • The tool registration definition within getTools() that defines the 'get_guidelines' tool name, description, and inputSchema with an optional 'category' string 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)',
          },
        },
      },
    },
  • The case branch in handleTool() that routes the 'get_guidelines' tool name to the getGuidelines() method.
    case 'get_guidelines':
      return await this.getGuidelines(args.category);
  • src/index.ts:48-52 (registration)
    The server-side registration binding via ListToolsRequestSchema handler that calls guidelinesManager.getTools() to expose the tool list (including 'get_guidelines') to the MCP client.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: guidelinesManager.getTools(),
      };
    });
  • The fetchGuidelines() method in UrlGuidelineSource that actually retrieves the guidelines content (markdown) from a URL source, constructing the URL from the base URL and optional category.
    async fetchGuidelines(category?: string): Promise<string> {
      try {
        const url = category ? `${this.baseUrl}/${category}.md` : `${this.baseUrl}/guidelines.md`;
        
        // Use native fetch or http module for Node.js
        const response = await this.httpGet(url);
        return response;
      } catch (error) {
        throw new Error(`Failed to fetch guidelines from ${this.baseUrl}: ${error}`);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. It only states 'Get development guidelines' without indicating side effects, access requirements, rate limits, or that it is a read-only operation. This is insufficient for safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence without fluff. It effectively communicates the core action in a front-loaded manner. Minor improvement possible by adding return behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one optional parameter and no output schema, the description lacks information about the return value format or content. This gap reduces completeness, as agents need to infer what is returned.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a description for the optional 'category' parameter. The tool description adds no new meaning or context about parameters, so it meets the baseline expectation but does not exceed it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The tool name 'get_guidelines' and description 'Get development guidelines from the configured source' clearly state the verb (Get) and resource (development guidelines). The action is distinct from siblings 'security_check' and 'validate_code', which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool over alternatives or in what context. The description does not mention prerequisites, exclusions, or preferred scenarios, leaving the agent without decision-support information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/miniOrangeDev/wp-code-review-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server