Skip to main content
Glama
bivex

Scancode License Analysis Tool for MCP

by bivex

Compare License Compatibility

mcp_ScancodeMCP_compare_license_compatibility

Compare two software licenses to determine compatibility and understand legal implications for combining code under different licenses.

Instructions

Legal compatibility verdict and explanation for two license types (e.g., MIT vs GPLv3).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
licenseAYesFirst license name (e.g., MIT, GPL-3.0)
licenseBYesSecond license name (e.g., Apache-2.0, GPL-2.0)

Implementation Reference

  • The handler function for the tool, which takes licenseA and licenseB, calls licenseCompatibilityVerdict, and returns the result as content.
    async ({ licenseA, licenseB }) => {
      // Use a built-in matrix for common licenses, else flag for manual review
      return { content: [{ type: "text", text: licenseCompatibilityVerdict(licenseA, licenseB) }] };
    }
  • Input schema defining parameters licenseA and licenseB using Zod validation.
    inputSchema: {
      licenseA: z.string().describe("First license name (e.g., MIT, GPL-3.0)") ,
      licenseB: z.string().describe("Second license name (e.g., Apache-2.0, GPL-2.0)")
    },
  • index.ts:138-152 (registration)
    Registration of the tool using server.registerTool, including title, description, inputSchema, and handler.
    server.registerTool(
      "mcp_ScancodeMCP_compare_license_compatibility",
      {
        title: "Compare License Compatibility",
        description: "Legal compatibility verdict and explanation for two license types (e.g., MIT vs GPLv3).",
        inputSchema: {
          licenseA: z.string().describe("First license name (e.g., MIT, GPL-3.0)") ,
          licenseB: z.string().describe("Second license name (e.g., Apache-2.0, GPL-2.0)")
        },
      },
      async ({ licenseA, licenseB }) => {
        // Use a built-in matrix for common licenses, else flag for manual review
        return { content: [{ type: "text", text: licenseCompatibilityVerdict(licenseA, licenseB) }] };
      }
    );
  • Helper function that implements the core logic for determining license compatibility based on a simple matrix of common licenses.
    function licenseCompatibilityVerdict(licenseA: string, licenseB: string): string {
      // Simple matrix for demo; real-world use would be more complex
      const a = licenseA.toLowerCase();
      const b = licenseB.toLowerCase();
      if (a === b) return `Both are ${licenseA}. Compatible.`;
      if ((a.includes("mit") && b.includes("gpl")) || (b.includes("mit") && a.includes("gpl"))) {
        return "MIT and GPL: MIT code can be included in GPL projects, but the combined work must be GPL. GPL code cannot be relicensed as MIT. Compatible with restrictions.";
      }
      if ((a.includes("mit") && b.includes("apache")) || (b.includes("mit") && a.includes("apache"))) {
        return "MIT and Apache: Compatible. Both are permissive, but Apache has extra patent terms.";
      }
      if ((a.includes("gpl") && b.includes("apache")) || (b.includes("gpl") && a.includes("apache"))) {
        return "GPL and Apache: Apache 2.0 is compatible with GPLv3, but not with GPLv2. Check versions.";
      }
      if (a.includes("proprietary") || b.includes("proprietary")) {
        return "Proprietary and open source: Usually incompatible. Legal review required.";
      }
      if (a.includes("unknown") || b.includes("unknown")) {
        return "Unknown license: Cannot determine compatibility. Legal review required.";
      }
      return "Compatibility unknown or complex. Legal review recommended.";
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the tool provides a 'verdict and explanation', which implies read-only analysis, but doesn't disclose behavioral traits like whether it requires network access, has rate limits, what format the explanation takes, or if it's authoritative for legal decisions. For a tool with no annotations, this leaves significant gaps in understanding its operation.

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 extremely concise and front-loaded in a single sentence. Every word earns its place: 'Legal compatibility verdict and explanation' defines the output, 'for two license types' specifies the input scope, and the parenthetical example clarifies usage without redundancy. No wasted words or unnecessary elaboration.

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?

Given the tool's moderate complexity (comparing legal licenses), no annotations, no output schema, and 100% schema coverage, the description is minimally adequate. It states what the tool does but lacks details on output format, reliability, or integration context. It meets the bare minimum for a read-only analysis tool but doesn't fully compensate for missing structured data.

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 both parameters clearly documented in the schema. The description adds minimal value beyond the schema by implying the parameters represent license types for comparison, but doesn't provide additional semantics like valid license formats, case sensitivity, or handling of aliases. Baseline 3 is appropriate since 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: to provide a 'legal compatibility verdict and explanation for two license types'. It specifies the verb ('compare'), resource ('license compatibility'), and scope ('two license types'). However, it doesn't explicitly differentiate from sibling tools like 'analyze_license_file' or 'summarize_license_risks', which prevents 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 or contexts where this comparison is appropriate versus other license analysis tools. The example 'e.g., MIT vs GPLv3' hints at usage but lacks explicit when/when-not instructions or prerequisites.

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/bivex/scancodeMCP'

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