Skip to main content
Glama

Find Unused JavaScript

find_unused_javascript
Read-only

Find unused JavaScript on a webpage to reduce bundle size and improve load performance. Provide a URL, device type, and minimum bytes threshold.

Instructions

Find unused JavaScript code to reduce bundle size

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to audit
deviceNoDevice to emulate (default: desktop)desktop
minBytesNoMinimum unused bytes to report (default: 2048)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
deviceYes
summaryYes
timestampYes
unusedFilesYes
thresholdBytesNo
recommendationsYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv1.0.27
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "device": {
      +      "type": "string"
      +    },
      +    "recommendations": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "summary": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "hasUnusedCode": {
      +          "type": "boolean"
      +        },
      +        "totalFilesAnalyzed": {
      +          "type": "number"
      +        },
      +        "totalUnusedKB": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "totalUnusedKB",
      +        "totalFilesAnalyzed",
      +        "hasUnusedCode"
      +      ],
      +      "type": "object"
      +    },
      +    "thresholdBytes": {
      +      "type": "number"
      +    },
      +    "timestamp": {
      +      "type": "string"
      +    },
      +    "unusedFiles": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "filename": {
      +            "type": "string"
      +          },
      +          "totalKB": {
      +            "type": "number"
      +          },
      +          "unusedKB": {
      +            "type": "number"
      +          },
      +          "unusedPercent": {
      +            "type": "number"
      +          },
      +          "url": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "filename",
      +          "totalKB",
      +          "unusedKB",
      +          "unusedPercent",
      +          "url"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "url": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "url",
      +    "device",
      +    "timestamp",
      +    "summary",
      +    "unusedFiles",
      +    "recommendations"
      +  ],
      +  "type": "object"
      +}
  2. Addedv1.0.26
  3. Removedv1.0.1
  4. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already carry readOnlyHint=true and openWorldHint=true, so the tool's non-destructive and open-world behavior is covered, and the description does not contradict the annotations. The description adds little beyond the generic 'find' behavior—no mention of how the scan is performed, what resources are fetched, or what output to expect—so it stays at the baseline for annotation-covered tools.

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 immediately states the tool's core function. It avoids filler and front-loads the verb and resource, making it easy for an agent to parse at a glance.

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?

The tool is simple, and the schema, annotations, and output schema fill in a lot. However, the description does not mention the need for a URL or clarify how this audit relates to the many other audit siblings, leaving the agent without enough context to confidently choose and invoke it among the broader toolset.

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 of the input parameters is 100%, so the baseline is 3. The description mentions bundle size, which loosely relates to minBytes, but it does not add detail about how url, device, or minBytes interplay; the schema carries the burden.

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 uses a specific verb ('Find') and a concrete resource ('unused JavaScript code'), and adds the motivating goal of reducing bundle size. It is clear enough to be distinguished from performance scoring tools, but it does not explicitly differentiate it from a sibling like analyze_resources, so it misses the 5 criterion.

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 is given on when to use this tool versus alternatives such as get_performance_score, analyze_resources, or run_audit. There are no conditions, prerequisites, or exclusion criteria—only a one-line purpose statement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/danielsogl/lighthouse-mcp-server'

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