Skip to main content
Glama
miniOrangeDev

WordPress Code Review MCP Server

security_check

Analyzes code for security vulnerabilities using configurable rules to identify and prevent potential threats in WordPress projects.

Instructions

Perform security analysis on code using configured security rules

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe code to check for security issues

Implementation Reference

  • Tool registration: defines the 'security_check' tool with name, description, and input schema (requires 'code' string).
    {
      name: 'security_check',
      description: 'Perform security analysis on code using configured security rules',
      inputSchema: {
        type: 'object',
        properties: {
          code: {
            type: 'string',
            description: 'The code to check for security issues',
          },
        },
        required: ['code'],
      },
    },
  • Tool dispatch: routes 'security_check' calls to performSecurityCheck(args.code).
    case 'security_check':
      return await this.performSecurityCheck(args.code);
  • Handler logic: performSecurityCheck() delegates to guidelineSource.performSecurityCheck(), then formats vulnerabilities, warnings, and recommendations into a human-readable text response.
    private async performSecurityCheck(code: string) {
      try {
        const result = await this.guidelineSource.performSecurityCheck(code);
        
        const response = [];
        
        if (result.vulnerabilities.length > 0) {
          response.push(`🚨 **Vulnerabilities Found:**\n${result.vulnerabilities.map(vuln => `- ${vuln}`).join('\n')}`);
        }
        
        if (result.warnings.length > 0) {
          response.push(`⚠️ **Warnings:**\n${result.warnings.map(warning => `- ${warning}`).join('\n')}`);
        }
        
        if (result.recommendations.length > 0) {
          response.push(`💡 **Recommendations:**\n${result.recommendations.map(rec => `- ${rec}`).join('\n')}`);
        }
        
        if (response.length === 0) {
          response.push('✅ Security check passed. No obvious vulnerabilities detected.');
        }
        
        return {
          content: [
            {
              type: 'text',
              text: response.join('\n\n'),
            },
          ],
        };
      } catch (error) {
        throw new Error(`Security check failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Interface definition: declares the return type of performSecurityCheck as { vulnerabilities: string[]; warnings: string[]; recommendations: string[] }.
    performSecurityCheck(code: string): Promise<{ vulnerabilities: string[]; warnings: string[]; recommendations: string[] }>;
  • Helper: UrlGuidelineSource.performSecurityCheck() fetches 'security-rules' guidelines and calls parseSecurityRules() to apply pattern-based rules against the code.
    async performSecurityCheck(code: string): Promise<{ vulnerabilities: string[]; warnings: string[]; recommendations: string[] }> {
      const securityGuidelines = await this.fetchGuidelines('security-rules');
      return this.parseSecurityRules(securityGuidelines, code);
    }
Behavior2/5

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

No annotations provided, so the description carries full burden. It does not disclose whether the tool is read-only, requires network, or modifies anything. Only states it performs analysis, lacking behavioral details.

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

Conciseness5/5

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

Single sentence, no wasted words. Front-loaded with the action and scope. Efficiently communicates the core function.

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

Completeness3/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 parameter and no output schema, the description is adequate but incomplete. It fails to mention the format of results (e.g., list of issues, pass/fail), which an agent would need to plan next steps.

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 single parameter 'code'. The description adds 'using configured security rules' but doesn't significantly enhance meaning beyond the schema. Baseline 3 is appropriate.

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

Purpose4/5

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

The description clearly states the tool analyzes code for security issues using configured rules. It distinguishes itself from sibling tools like 'validate_code' by focusing on security, though it doesn't explicitly differentiate.

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 on when to use this tool versus alternatives like 'get_guidelines' or 'validate_code'. The description provides no context for appropriate use cases or limitations.

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