Skip to main content
Glama

modernize_legacy_code

Convert legacy code snippets to modern production code: CommonJS to ESM, classes to hooks, var to const, callbacks to async/await, and JavaScript to TypeScript.

Instructions

Transforms legacy code snippets into modern production code (CommonJS require -> ESM imports, Class components -> React Hooks, var -> const/let, callbacks -> async/await, JavaScript -> TypeScript).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
code_snippetYesThe legacy code snippet to modernize
target_languageYesTarget modernization stack
Behavior2/5

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

Annotations are absent, so the description carries the full burden of behavioral disclosure. It states the tool 'transforms' code, implying mutation, but does not clarify whether it returns the modernized snippet, writes to a file, or modifies input in place. It also omits side effects, error conditions, and limitations. This lack of transparency is a significant gap for a tool with no annotation support.

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, well-structured sentence that front-loads the core action ('Transforms legacy code snippets') and packs additional detail into a parenthetical list. It is concise, efficient, and every element contributes to understanding. There is no redundant or filler content.

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?

The tool has no output schema and no annotations, so the description must convey the full context. It explains what transformations are performed but omits critical details: the return value (does it return the modernized code string?), possible errors (e.g., invalid input), and limitations (e.g., might not handle all modern features). Given the moderate complexity (2 params, enums), the description is incomplete and leaves the agent uncertain about post-call behavior.

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?

The schema already provides 100% coverage with descriptions for both parameters. The description adds value by enumerating specific transformation mappings (e.g., 'CommonJS require -> ESM imports', 'Class components -> React Hooks') that clarify what each target_language option implies. This helps an agent select the correct target based on the legacy code's characteristics, going beyond the schema's generic 'Target modernization stack' label.

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?

The description states a specific verb ("Transforms"), a specific resource ("legacy code snippets"), and enumerates concrete transformations (CommonJS->ESM, Class->Hooks, etc.). This clearly distinguishes it from siblings like 'ponytail_codebase_modernizer', which appear to target full codebases rather than snippets. The purpose is unambiguous.

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?

There is no guidance on when to use this tool versus alternatives. It does not mention that for full-codebase modernization one might use 'ponytail_codebase_modernizer', nor does it state any prerequisites, exclusions, or specific scenarios. The agent must infer that it is intended for snippets, but no explicit usage direction is provided.

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/Akash1070/Super-Agent-Skill'

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