Skip to main content
Glama
jgauffin

ts-language-mcp

by jgauffin

apply_code_fix

Apply a code fix—returned by get_code_fixes—to a TypeScript file. Target by symbol name or file/line/column, optionally fix all occurrences in the file.

Instructions

Apply one of the fixes returned by get_code_fixes and write it to disk. Set applyToAll to fix every occurrence of the same problem in the file. Target it either by "symbol" name (preferred: no need to know coordinates) or by explicit file/line/column.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoPath to the file (relative to project root)
lineNoLine number (1-based)
columnNoColumn number (1-based)
symbolNoName of the symbol to target, instead of line/column. Qualify as "Container.member" (e.g. "UserService.getUser") to disambiguate. Combine with "file" to restrict the search to one file. An ambiguous name returns an error listing the candidates.
fixNameYesThe fixName of the fix to apply, as returned by get_code_fixes.
applyToAllNoApply the same fix to every occurrence in the file (default: false). Only available for fixes that report a fixAllDescription.
Behavior4/5

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

With no annotations provided, the description carries the full burden. It reveals that the tool writes to disk (destructive), that ambiguous symbols return an error listing candidates, and that applyToAll is conditional. It does not cover authentication or rollback, but the disclosed behaviors are relevant and significant for an agent.

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 three sentences, each serving a distinct purpose: overall action, applyToAll usage, and targeting options. No extraneous words or redundancy. It is well-structured and front-loaded with the core purpose.

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?

Given 6 parameters, conditional logic, and no output schema, the description covers the essential usage patterns (targeting, applyToAll conditions, error handling for ambiguous symbols). It does not explicitly describe the return value or what 'success' looks like, but for a mutation tool this is a minor gap. The information is largely complete for an agent to invoke 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?

Although schema coverage is 100% (all parameters documented in schema), the description adds meaning beyond the schema: it explains why symbol targeting is preferred (no coordinates needed), that combining symbol with file restricts search, the error behavior for ambiguous symbols, and the condition for applyToAll. This adds valuable semantic context.

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 verb 'Apply' and the resource 'one of the fixes returned by get_code_fixes and write it to disk'. It distinguishes itself from the sibling tool get_code_fixes (which returns fixes) by focusing on application and persistence. The purpose is specific and unambiguous.

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 advises to use fixes from get_code_fixes and explains two targeting methods (preferring symbol over coordinates). It also notes the applyToAll option and its precondition (fixAllDescription). However, it does not explicitly state when not to use this tool or compare it to other mutation tools like rename_symbol, but the context of fixes makes the usage reasonably clear.

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/jgauffin/ts-language-mcp'

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