Skip to main content
Glama
theSharque
by theSharque

Refactor Architecture

refactor-architecture

Preview and apply refactoring operations to your project architecture data. Scan files, move paths, rename texts, patch entries, merge files, and remove references with a dry-run mode before committing.

Instructions

Preview or apply in-repo refactor sync to architector data (no workspace access). Default dryRun=true. Workflow: (1) scan with file/text to list hits, (2) build 1-3 mutation ops, (3) dryRun preview, (4) apply with dryRun=false and confirm=true. Mutations: move-file, replace-path-prefix, rename-text, patch-entry, merge-files, remove-file-ref. Orphan entries with empty refs.files and no entryIds are deleted. Does not change module names or dataFlow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoProject ID (defaults to normalized workdir)
operationsYesRefactor operations (max 10 per call)
scopeNoOptional filter: moduleName, kinds, tags
dryRunNoPreview only (default true). Set false with confirm=true to apply
confirmNoRequired true when dryRun=false
limitNoMax changes/hits per page (default 15, max 50)
offsetNoPagination offset (default 0)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dryRunYes
summaryYes
statsYes
hitsNo
changesYes
warningsYes
offsetYes
hasMoreYes
Behavior5/5

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

With no annotations, the description carries full burden and does so excellently. It discloses that orphan entries are deleted, module names and dataFlow are untouched, default dryRun behavior, and the types of mutations. No contradictions with metadata.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear first sentence stating purpose, then workflow steps, then specifics. It is relatively concise for the complexity, though could be slightly tighter. Front-loaded with key information.

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 the tool's complexity (multi-step refactor, many operation types), the description covers most aspects. It doesn't detail return values, but an output schema exists. The preview step is mentioned but not fully described in terms of response format. Still, it is largely complete.

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?

Schema coverage is 100%, so baseline is 3. The description adds value by explaining the workflow ordering, relationship between dryRun and confirm, and operation constraints (max 10). This goes beyond the schema's descriptive fields.

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's purpose: 'Preview or apply in-repo refactor sync to architector data'. It lists specific mutation types (move-file, replace-path-prefix, etc.) and distinguishes from sibling CRUD tools by focusing on refactoring operations.

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 provides a clear 4-step workflow (scan, build ops, dryRun, apply) and explains the default dryRun=true and confirm requirement. While it doesn't explicitly contrast with siblings, the specialized purpose implicitly guides usage. The note 'no workspace access' provides context.

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/theSharque/mcp-architect'

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