Skip to main content
Glama
code-alchemist01

Development Tools MCP Server

scan_security_issues

Scan code files to identify security issues like exposed secrets, vulnerabilities, and insecure coding patterns.

Instructions

Scan code for security issues including secrets, vulnerabilities, and insecure patterns

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYesFile paths to scan

Implementation Reference

  • Registers the 'scan_security_issues' tool with name, description, and input schema requiring an array of file paths.
    {
      name: 'scan_security_issues',
      description: 'Scan code for security issues including secrets, vulnerabilities, and insecure patterns',
      inputSchema: {
        type: 'object',
        properties: {
          files: {
            type: 'array',
            items: { type: 'string' },
            description: 'File paths to scan',
          },
        },
        required: ['files'],
      },
    },
  • Input schema for the tool: object with 'files' array of strings.
    inputSchema: {
      type: 'object',
      properties: {
        files: {
          type: 'array',
          items: { type: 'string' },
          description: 'File paths to scan',
        },
      },
      required: ['files'],
    },
  • Tool handler case: reads files using FileReader, scans with SecurityAnalyzer.scanSecurityIssues, returns aggregated issue counts and full list.
    case 'scan_security_issues': {
      const files = params.files as string[];
      const codeFiles = await FileReader.readFiles(files.join(','));
      const issues = await securityAnalyzer.scanSecurityIssues(codeFiles);
      return {
        total: issues.length,
        critical: issues.filter((i) => i.severity === 'critical').length,
        high: issues.filter((i) => i.severity === 'high').length,
        medium: issues.filter((i) => i.severity === 'medium').length,
        low: issues.filter((i) => i.severity === 'low').length,
        issues,
      };
    }
  • Core handler implementation: orchestrates scanning of code files by calling helper methods for secrets, weak auth, and permission issues.
    async scanSecurityIssues(files: CodeFile[] | string[]): Promise<SecurityIssue[]> {
      const codeFiles = await this.getCodeFiles(files);
      const issues: SecurityIssue[] = [];
    
      for (const file of codeFiles) {
        // Detect hardcoded secrets
        issues.push(...this.detectSecrets(file));
    
        // Detect weak authentication
        issues.push(...this.detectWeakAuth(file));
    
        // Detect insecure dependencies (would check package.json in real implementation)
        // Detect permission issues
        issues.push(...this.detectPermissionIssues(file));
      }
    
      return issues;
    }
  • Helper method to detect hardcoded secrets using regex patterns for passwords, API keys, etc.
    private detectSecrets(file: CodeFile): SecurityIssue[] {
      const issues: SecurityIssue[] = [];
      const lines = file.content.split('\n');
    
      // Common secret patterns
      const secretPatterns = [
        {
          pattern: /(?:password|passwd|pwd)\s*[=:]\s*["']([^"']+)["']/gi,
          type: 'password' as const,
          severity: 'critical' as const,
        },
        {
          pattern: /(?:api[_-]?key|apikey)\s*[=:]\s*["']([^"']+)["']/gi,
          type: 'api_key' as const,
          severity: 'critical' as const,
        },
        {
          pattern: /(?:secret|token)\s*[=:]\s*["']([^"']+)["']/gi,
          type: 'secret' as const,
          severity: 'high' as const,
        },
        {
          pattern: /(?:aws[_-]?access[_-]?key|aws[_-]?secret)\s*[=:]\s*["']([^"']+)["']/gi,
          type: 'aws_credentials' as const,
          severity: 'critical' as const,
        },
        {
          pattern: /(?:private[_-]?key|ssh[_-]?key)\s*[=:]\s*["']([^"']+)["']/gi,
          type: 'private_key' as const,
          severity: 'critical' as const,
        },
      ];
    
      for (let i = 0; i < lines.length; i++) {
        const line = lines[i];
        for (const { pattern, type, severity } of secretPatterns) {
          if (pattern.test(line)) {
            issues.push({
              type: 'secret',
              severity,
              location: `${file.path}:${i + 1}`,
              description: `Potential hardcoded ${type} detected`,
              recommendation: 'Move secrets to environment variables or secure configuration',
              detectedAt: new Date(),
            });
          }
        }
      }
    
      return issues;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions scanning for security issues but doesn't disclose behavioral traits such as whether this is a read-only operation, if it modifies files, what permissions are required, performance characteristics, or output format. For a security scanning tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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?

The description is a single, efficient sentence that front-loads the core action ('scan code for security issues') and elaborates with examples ('including secrets, vulnerabilities, and insecure patterns'). There is zero wasted verbiage, and it's appropriately sized for the tool's complexity.

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?

Given the complexity of security scanning, no annotations, no output schema, and incomplete behavioral disclosure, the description is inadequate. It doesn't explain what the tool returns, how results are structured, or critical behavioral aspects. For a tool with potential side effects or significant output, this leaves too many unknowns for effective agent use.

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 description coverage is 100%, with the single parameter 'files' fully documented in the schema as 'File paths to scan'. The description adds no additional parameter semantics beyond what the schema provides, such as file format constraints or scanning depth. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but doesn't need to heavily.

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 verb 'scan' and resource 'code' with specific targets: 'security issues including secrets, vulnerabilities, and insecure patterns'. This distinguishes it from siblings like 'detect_secrets' (narrower) and 'check_vulnerabilities' (different focus), though it doesn't explicitly contrast with them. The purpose is specific but could better differentiate from overlapping tools.

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 'detect_secrets' or 'check_vulnerabilities' is provided. The description implies a broad security scan context, but it lacks explicit when/when-not instructions or prerequisites. Usage is only vaguely implied by the tool's name and description.

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/code-alchemist01/development-tools-mcp-Server'

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