Skip to main content
Glama
AndyLiner13

ts-mcp-server

by AndyLiner13

Organize Imports

organizeImports
DestructiveIdempotent

Sort, coalesce, and remove unused imports in TypeScript or JavaScript files. Uses TypeScript's native organizeImports to clean up import statements for files in a tsconfig.json project.

Instructions

Sort, coalesce, and remove unused imports in a TypeScript/JavaScript file. Uses TypeScript's native organizeImports with mode 'All' (sorts, coalesces, and removes unused). Requires the file to be part of a tsconfig.json project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesFile path (absolute or relative to cwd)
previewYesIf true, only preview changes
Behavior4/5

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

The description adds detail beyond annotations by specifying that it uses TypeScript's native organizeImports with mode 'All', explaining the exact behavior (sorts, coalesces, removes unused). This aligns with the idempotentHint and destructiveHint annotations without contradiction.

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 concise with two well-structured sentences, front-loading the main action and following with important context. No unnecessary words.

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?

For a simple tool with two parameters and no output schema, the description provides sufficient information: what the tool does, how it works, and a critical prerequisite. The behavioral details (sorts, coalesces, removes unused) cover the main outcomes.

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 is 100% and parameter descriptions are clear. The description adds context that the file must be part of a tsconfig.json project, which is useful but not a significant addition beyond the schema.

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 clearly states the tool sorts, coalesces, and removes unused imports in TypeScript/JavaScript files, specifying the verb and resource. It distinguishes from sibling tools like format or getCodeFixes by focusing specifically on import organization.

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?

The description includes a prerequisite ('Requires the file to be part of a tsconfig.json project'), which helps the user know when the tool is applicable. However, it does not explicitly mention when to use this tool versus alternatives like format, though the context implies it.

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/AndyLiner13/ts-mcp-server'

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