Skip to main content
Glama

Project Scanner

scan_project

Analyze project files to detect CSS/JS features and check browser compatibility for specified targets, helping identify potential compatibility issues.

Instructions

Analyze project files to detect CSS/JS features and check compatibility across browser targets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathNoPath to the project directory to scan (default: current directory).
targetsNoBrowser targets to check (e.g., 'chrome-37', 'firefox-esr', 'safari-12')
maxDepthNoMaximum directory depth to scan
excludeDirsNoDirectories to exclude from scanning

Implementation Reference

  • The handler function that implements the core logic of the 'scan_project' tool. It processes input arguments, invokes the compatibility checker on the project, and returns a formatted response with scan results, compatibility scores, and recommendations.
    export async function handleScanProject(args) {
      const {
        projectPath = '.',
        targets = ['chrome-37'],
        maxDepth = 5,
        excludeDirs = ['node_modules', '.git', 'dist', 'build']
      } = args;
    
      const scanOptions = {
        maxDepth,
        excludeDirs
      };
    
      const result = await compatibilityChecker.checkProjectCompatibility(
        projectPath, 
        { targets, scanOptions, includeRecommendations: true }
      );
    
      // Format for better UX
      return {
        status: result.status || 'completed',
        project: {
          path: projectPath,
          scanned: `${result.projectScan?.totalFiles || 0} files`,
          jsFiles: result.projectScan?.jsFiles || 0,
          cssFiles: result.projectScan?.cssFiles || 0,
          featuresDetected: result.features?.length || 0
        },
        compatibility: {
          targets: Object.keys(result.compatibility || {}),
          overallScore: result.summary?.overallScore || 100,
          criticalIssues: result.summary?.criticalIssues?.length || 0,
          commonUnsupported: result.summary?.commonUnsupported || []
        },
        recommendations: result.recommendations || [],
        nextSteps: result.nextSteps || [],
        detailedResults: {
          features: result.features,
          targetResults: result.compatibility,
          summary: result.summary
        }
      };
    }
  • index.js:15-50 (registration)
    Registers the 'scan_project' tool with the MCP server, defining its metadata, input schema, and the wrapper handler that calls the core handleScanProject function and formats the MCP response.
    server.registerTool(
      "scan_project",
      {
        title: "Project Scanner",
        description: "Analyze project files to detect CSS/JS features and check compatibility across browser targets",
        inputSchema: {
          projectPath: z.string().optional().default(".").describe("Path to the project directory to scan (default: current directory)"),
          targets: z.array(z.string()).optional().default(["chrome-37"]).describe("Browser targets to check (e.g., 'chrome-37', 'firefox-esr', 'safari-12')"),
          maxDepth: z.number().optional().default(5).describe("Maximum directory depth to scan"),
          excludeDirs: z.array(z.string()).optional().default(["node_modules", ".git", "dist", "build"]).describe("Directories to exclude from scanning")
        }
      },
      async (args) => {
        try {
          const result = await handleScanProject(args);
          return {
            content: [{
              type: "text",
              text: JSON.stringify(result, null, 2)
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: JSON.stringify({
                error: true,
                message: error.message,
                suggestion: "Try using 'scan_project' to automatically detect and check your project's compatibility."
              }, null, 2)
            }],
            isError: true
          };
        }
      }
    );
  • Zod-based input schema defining the parameters for the 'scan_project' tool, including project path, browser targets, scan depth, and exclusion rules.
    inputSchema: {
      projectPath: z.string().optional().default(".").describe("Path to the project directory to scan (default: current directory)"),
      targets: z.array(z.string()).optional().default(["chrome-37"]).describe("Browser targets to check (e.g., 'chrome-37', 'firefox-esr', 'safari-12')"),
      maxDepth: z.number().optional().default(5).describe("Maximum directory depth to scan"),
      excludeDirs: z.array(z.string()).optional().default(["node_modules", ".git", "dist", "build"]).describe("Directories to exclude from scanning")
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions what the tool does (analyzing and checking compatibility), it doesn't describe important behavioral aspects: whether this is a read-only operation, what the output format looks like, whether it modifies files, performance characteristics, or error handling. For a scanning tool with 4 parameters and no annotations, this leaves significant gaps.

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 gets straight to the point with zero wasted words. It's appropriately sized for the tool's complexity and front-loads the core functionality. Every word earns its place by conveying essential information about what the tool does.

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 scanning tool with 4 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what the output looks like (compatibility reports? feature lists? error summaries?), doesn't mention whether this is a safe read operation, and provides no context about performance or limitations. The agent would be left guessing about important operational aspects.

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%, so the schema already documents all 4 parameters thoroughly with descriptions and defaults. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain relationships between parameters, provide examples beyond what's in the schema, or clarify edge cases. The baseline of 3 is appropriate when the schema does the heavy lifting.

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's purpose: 'Analyze project files to detect CSS/JS features and check compatibility across browser targets.' It specifies the verb ('analyze'), resource ('project files'), and what it detects ('CSS/JS features') plus the compatibility checking function. However, it doesn't explicitly differentiate from sibling tools like 'check_compatibility' or 'get_fixes' which might have overlapping functionality.

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?

The description provides no guidance on when to use this tool versus alternatives like 'check_compatibility' or 'get_fixes'. It doesn't mention prerequisites, when-not-to-use scenarios, or how it differs from sibling tools. The agent would have to infer usage from the tool name and description alone.

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/Amirmahdi-Kaheh/caniuse-mcp'

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