Skip to main content
Glama

suggest_refactoring

Read-only

WHEN: developer wants to improve code quality before a PR merge or code review. Triggers: 'refactor', 'clean up', 'simplify', 'too long method', 'nested ifs', 'code smells', 'améliorer le code'. Suggest concrete refactoring actions for YOUR custom D365 F&O X++ code. [!] Only runs on custom/extension code (D365_CUSTOM_MODEL_PATH). Refactoring standard Microsoft code is not actionable. Analyzes: long methods (extract method), deep nesting (guard clauses), row-by-row operations (set-based), large switch statements (strategy pattern), hardcoded strings (constants), unprotected CLR calls (error handling), wide transactions (narrow scope). Returns before/after code examples.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNameNoOptional: specific method to analyze.
objectNameYesObject name to analyze, e.g. 'ALMMyClass', 'ALMMyTable'

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already mark the tool as read-only; the description adds helpful context by limiting analysis to custom/extension code (D365_CUSTOM_MODEL_PATH), enumerating seven concrete refactoring patterns, and promising before/after code examples. This goes beyond the annotation without contradicting it.

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 WHEN heading front-loads the most important decision signal, and the trigger list plus analysis categories are compressed but useful. Every sentence contributes either scope, trigger, or output information; there is no filler.

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 two-parameter read-only analysis tool without an output schema, the description covers intent, scope, analysis dimensions, and the return shape (before/after examples). The only minor gap is behavior on non-custom objects, but 'not actionable' makes the outcome clear enough.

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 explains objectName and methodName, including optionality and an example object name. The description adds high-level context about analyzed patterns but no new per-parameter semantics, so the baseline 3 applies.

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 names a specific verb ('suggest ... refactoring actions') and a specific resource (custom D365 F&O X++ code), with explicit boundaries versus standard code. It distinguishes from sibling analysis tools like detect_performance_issues or fix_best_practice_violations by focusing on refactoring patterns and before/after examples.

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?

It opens with a WHEN clause and concrete trigger phrases, and states the key exclusion: standard Microsoft code is not actionable. It does not, however, name sibling alternatives explicitly, so routing is clear but not exhaustive.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.1/5.0
Disambiguation4/5

Most tools have distinct purposes and clear triggers, reducing ambiguity. For example, PR-related tools are separated into analysis, listing, commenting, and dependency mapping. However, some overlap exists between find_references, find_extensions, and find_callers, which could confuse an agent without careful descriptions.

Naming Consistency4/5

Tool names follow a consistent snake_case pattern with verb_noun structure within subgroups (e.g., ado_*, find_*, search_*, generate_*). There is no mixing of camelCase or other styles, though the variety of prefixes slightly reduces predictability.

Tool Count3/5

With 38 tools, the server feels slightly over-scoped for its domain. While each tool has a specific function, the number is high compared to typical well-scoped servers (10-15 tools). Some tools like find_references and find_callers could be consolidated.

Completeness4/5

The tool set covers a broad range of D365 F&O development and DevOps tasks, including code search, analysis, security, performance, upgrades, and work item management. Minor gaps exist, such as the absence of direct object modification or batch job management, but the core workflows are well covered.