Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

minify_js

Read-onlyIdempotent

Minify a JavaScript snippet, function, class, or module up to 50 KB using Terser. Returns minified code and byte savings. Use when embedding scripts in HTML templates, report payloads, or injecting inline code programmatically.

Input Schema

NameRequiredDescriptionDefault
codeYesJavaScript code to minify (max 50kb)

Output Schema

NameRequiredDescriptionDefault
minifiedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "code": "function add(a, b) {\n  return a + b;\n}"
      +  }
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "minified": {}
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  4. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover readOnly, idempotent, non-destructive, closed-world. The description adds valuable context: the 50 KB cap, the Terser engine, and that it returns minified code plus byte savings. It does not discuss failure modes (e.g., invalid JS syntax) — a minor gap against an otherwise informative entry.

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?

Three tight sentences: capability first, return contract second, usage guidance last. Zero filler; every clause carries information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite an available output schema and rich annotations, the description still communicates the return shape, size limit, and use contexts, leaving no information gap for an agent to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only one parameter, fully documented in the schema (100% coverage), so the baseline is high. The description adds meaning by enumerating what 'code' can be (snippet, function, class, module) and reiterating the 50 KB limit, giving slightly more than the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (minify) and resource (JavaScript snippet/function/class/module), names the underlying engine (Terser), and gives a size ceiling of 50 KB. An agent can immediately distinguish this from siblings like format_json or html_to_markdown.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly lists when to use it: embedding scripts in HTML templates, report payloads, or injecting inline code. No explicit exclusions or named alternatives, but no sibling in the list is a direct substitute, so the context is quite clear.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.