Skip to main content
Glama

Compatibility Checker

check_compatibility

Check CSS and JavaScript features against multiple browser targets to identify compatibility issues and get remediation steps.

Instructions

Check specific features or files against multiple browser targets with detailed analysis

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featuresNoSpecific caniuse feature names to check (e.g., 'flexbox', 'css-grid')
filesNoSpecific file paths to analyze for features
targetsNoBrowser targets (chrome-37, firefox-esr, safari-12, ie-11, edge-legacy)

Implementation Reference

  • Core implementation of the check_compatibility tool handler. Processes input arguments (features, files, targets), scans specified files for features if provided, performs compatibility checks via EnhancedCompatibilityChecker, and returns structured results with summary, recommendations, and detailed compatibility data.
    export async function handleCheckCompatibility(args) {
      const { features, files, targets = ['chrome-37'] } = args;
    
      let featuresToCheck = features || [];
    
      // If files are provided, scan them for features
      if (files && files.length > 0) {
        const scanResults = await projectScanner.scanSpecificFiles(files);
        const detectedFeatures = [...new Set(scanResults.flatMap(r => r.features))];
        featuresToCheck = [...new Set([...featuresToCheck, ...detectedFeatures])];
      }
    
      if (featuresToCheck.length === 0) {
        return {
          status: 'no-features',
          message: 'No features specified or detected in files',
          suggestion: 'Either provide specific features to check, or use scan_project to auto-detect features',
          availableTargets: compatibilityChecker.getSupportedBrowserTargets()
        };
      }
    
      const result = await compatibilityChecker.checkSpecificFeatures(featuresToCheck, { targets });
    
      return {
        features: featuresToCheck,
        targets,
        compatibility: result.compatibility,
        summary: {
          overallScore: result.summary.overallScore,
          byTarget: result.summary.targets,
          unsupportedFeatures: result.summary.commonUnsupported
        },
        recommendations: result.summary.commonUnsupported.length > 0 
          ? [`Use get_fixes tool with features: ${result.summary.commonUnsupported.slice(0, 5).join(', ')}`]
          : ['All features are supported in the specified targets'],
        detailedResults: result
      };
    }
  • index.js:53-87 (registration)
    MCP server registration of the check_compatibility tool, including Zod-based input schema for features, files, and targets, and wrapper that calls the handler function with error handling.
    server.registerTool(
      "check_compatibility",
      {
        title: "Compatibility Checker",
        description: "Check specific features or files against multiple browser targets with detailed analysis",
        inputSchema: {
          features: z.array(z.string()).optional().describe("Specific caniuse feature names to check (e.g., 'flexbox', 'css-grid')"),
          files: z.array(z.string()).optional().describe("Specific file paths to analyze for features"),
          targets: z.array(z.string()).optional().default(["chrome-37"]).describe("Browser targets (chrome-37, firefox-esr, safari-12, ie-11, edge-legacy)")
        }
      },
      async (args) => {
        try {
          const result = await handleCheckCompatibility(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: "Check the input parameters and try again. Use 'scan_project' first to detect features automatically."
              }, null, 2)
            }],
            isError: true
          };
        }
      }
    );
  • Zod input schema defining parameters for the check_compatibility tool: optional arrays of features and files to check, and browser targets with default.
      inputSchema: {
        features: z.array(z.string()).optional().describe("Specific caniuse feature names to check (e.g., 'flexbox', 'css-grid')"),
        files: z.array(z.string()).optional().describe("Specific file paths to analyze for features"),
        targets: z.array(z.string()).optional().default(["chrome-37"]).describe("Browser targets (chrome-37, firefox-esr, safari-12, ie-11, edge-legacy)")
      }
    },
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 of behavioral disclosure. It mentions 'detailed analysis' but doesn't specify what that entails—e.g., output format, performance implications, rate limits, or authentication needs. For a tool with no annotation coverage, this is a significant gap in transparency.

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, efficient sentence that front-loads the core purpose. It avoids redundancy and waste, making it easy to parse. However, it could be slightly more structured by explicitly separating feature and file checks, but this is minor.

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 tool's complexity (3 parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavioral traits, output format, and usage guidelines. Without annotations or an output schema, the agent is left guessing about the tool's full behavior and results, making this inadequate for effective 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%, so the schema already documents all three parameters thoroughly. The description adds minimal value beyond the schema by implying the tool checks 'specific features or files' against 'multiple browser targets,' but it doesn't provide additional syntax, format details, or usage examples. Baseline 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: 'Check specific features or files against multiple browser targets with detailed analysis.' It specifies the verb ('check'), resources ('features or files'), and scope ('multiple browser targets'). However, it doesn't explicitly differentiate from sibling tools like 'scan_project' or 'get_fixes,' which might have overlapping functionality, preventing a perfect score.

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. It doesn't mention sibling tools like 'scan_project' or 'get_fixes,' nor does it specify prerequisites, exclusions, or typical use cases. This leaves the agent without context for tool selection.

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