Skip to main content
Glama

ReSharper Cleanup Code

resharper_cleanup
DestructiveIdempotent

Runs ReSharper code cleanup on specified C# files to fix formatting, code style, unused usings, var usage, modifier order, and braces in place; include every modified file in one call.

Instructions

Run ReSharper code cleanup to format files in place, fixing formatting, code style, unused usings, var usage, modifier order and braces. Each call loads the files' projects and their references before it rewrites anything, so make one call per task with every modified file in it.

Input Schema

NameRequiredDescriptionDefault
filesYesFile paths to clean up. Each is relative to the solution root, or absolute. jb matches them against the files that belong to a project in the solution, so one that is on disk but in no project matches nothing, which nothing here can detect. Wildcards are allowed and expanded by jb; a non-wildcard path that does not exist fails the whole call before anything is rewritten. An element joining several paths with ; or , is split into separate paths.
profileNoReSharper cleanup profile name. Defaults to the profile the solution declares, else full cleanup.
solutionPathNoPath to the .sln, .slnx or .slnf to run against. Overrides JB_SOLUTION_PATH and working-directory discovery.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.8.0
    • changedInput schema / properties / solutionPath / description
      Previous value: -"Path to the .sln/.slnx to run against. Overrides JB_SOLUTION_PATH and working-directory discovery."New value: +"Path to the .sln, .slnx or .slnf to run against. Overrides JB_SOLUTION_PATH and working-directory discovery."
  2. Changed1 schema field changedv1.7.0
    • changedInput schema / properties / files / description
      Previous value: -"File paths to clean up. Each is relative to the solution root, or absolute. jb matches them against the files that belong to a project in the solution, so one that is on disk but in no project matches nothing. Wildcards are allowed and expanded by jb; a non-wildcard path that does not exist fails the whole call before anything is rewritten. An element joining several paths with ; or , is split into separate paths."New value: +"File paths to clean up. Each is relative to the solution root, or absolute. jb matches them against the files that belong to a project in the solution, so one that is on disk but in no project matches nothing, which nothing here can detect. Wildcards are allowed and expanded by jb; a non-wildcard path that does not exist fails the whole call before anything is rewritten. An element joining several paths with ; or , is split into separate paths."
  3. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare destructive=true, idempotent=true, readOnly=false, so the risk profile is known. The description adds genuinely new behavior: the tool loads the files' projects and references before rewriting, which explains cost and why batching matters — context the annotations cannot convey.

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?

Two sentences, both front-loaded and dense with useful information: the first defines the operation, the second explains cost and the batching rule. No filler or restatement of the title.

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 destructive, mutating tool with no output schema and full schema coverage, the description covers purpose, cost behavior, and batching well. It does not say what is returned or how failures relate to partial rewrites, a minor gap given the schema already documents pre-write failure handling.

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 description coverage is 100%, so the schema already documents files, profile, and solutionPath thoroughly, including wildcard and separator behavior. The description only reinforces the batching aspect of 'files'; baseline 3 applies when the schema does the heavy lifting.

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 specific verb (run cleanup) and resource (files), and enumerates exactly what it fixes: formatting, code style, unused usings, var usage, modifier order, braces. It is clearly a rewrite-in-place operation, distinct from a read-only sibling like resharper_inspect, though the sibling is not named.

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?

Gives explicit operational guidance: 'make one call per task with every modified file in it' tells the agent how to batch rather than call repeatedly. It lacks an explicit when-not/alternative statement (e.g., use inspect to preview), but the usage context is clear.

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