Skip to main content
Glama

Compact JavaScript source

minify-js
Read-onlyIdempotent

Compact small JavaScript snippets. Use for basic source cleanup, not AST-aware production minification. Returns JavaScript text, sometimes unchanged for complex syntax; regression-test its behavior.

Input Schema

NameRequiredDescriptionDefault
codeYesJavaScript source code string, limited to 4096 characters.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, so the safety profile is covered. The description adds genuinely non-obvious behavior beyond that: output may be returned unchanged for complex syntax and the user is warned to regression-test it, which is useful operational context.

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 with zero filler, and the core purpose is front-loaded in the first clause. Every sentence earns its place: scope, exclusion, and the return/behavior caveat.

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

Completeness4/5

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

For a single-param, no-output-schema tool, the description usefully covers the return type ('Returns JavaScript text') and the caveat about unchanged output. Combined with annotations carrying the safety profile, an agent has what it needs, though a hint at size/edge limits beyond the schema would round it out.

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?

With a single parameter and 100% schema description coverage, the schema already documents 'code' and its 4096-character limit. The description's 'small snippets' phrasing corroborates but adds no syntax, format or encoding detail beyond what the schema provides, so the baseline 3 applies.

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?

States a concrete verb and resource ('Compact small JavaScript snippets') and scopes it against a stronger alternative ('not AST-aware production minification'), so an agent knows this is a basic JS compactor. It distinguishes from minify-css/minify-html only implicitly via the 'JavaScript' resource and never names a sibling, so it falls short of full sibling differentiation.

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?

'Use for basic source cleanup, not AST-aware production minification' gives both a use case and an explicit exclusion, which is more than most definitions offer. It stops short of naming an alternative tool or stating concrete conditions, so it is clear context rather than full when/when-not/alternative guidance.

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.

Resources