Skip to main content
Glama

generate_unit_test

Read-only

WHEN: developer needs to write or scaffold unit tests for a custom D365 object. Triggers: 'generate tests', 'unit test', 'SysTest', 'write test for', 'scénarios de test', 'test this class'. Generate X++ SysTest unit test code for a CUSTOM D365 F&O object based on functional test scenarios. [!] Only meaningful on custom/extension code (D365_CUSTOM_MODEL_PATH). SysTest tests in D365 are highly context-specific -- a generic template rarely compiles without adaptation. REQUIRED: provide test scenarios in the 'testScenarios' parameter (supplied by the functional consultant). Each scenario becomes a concrete test method with arrange/act/assert. For tables: generates tests for find(), exist(), validateWrite(), initValue(). For classes: generates stubs for each public method listed in scenarios. Uses REAL field names and method signatures from the knowledge base.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNameNoOptional: specific method to test. If not provided, generates tests for all testable methods.
objectNameYesObject name to generate tests for, e.g. 'ALMERSftpConnectionTable', 'ALMMyClass'
sampleValuesNoOptional: JSON object mapping field name to sample value used in each ARRANGE block, e.g. '{"AccountNum":"C0001","Amount":1500.50}'. Replaces the 'TODO: set up test data' placeholders with concrete assignments.
testScenariosNoTest scenarios provided by the functional consultant, e.g. 'Create a connection with valid SFTP host; Validate that empty host fails; Delete cleans up related records'. Separate scenarios with semicolons.

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses that generated templates 'rarely compiles without adaptation,' implying the output needs manual work. It also explains per-type behavior (find(), exist(), validateWrite(), initValue() for tables; stubs for public methods for classes) and states it uses 'REAL field names and method signatures from the knowledge base.' No contradiction with readOnlyHint since generating code without persisting is read-only.

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 dense but well-structured: trigger phrases and the WHEN condition are front-loaded, and the [!], REQUIRED, and per-type notes are scannable. Every sentence contributes (triggers, scope, caveat, required input, behavior, knowledge-base sourcing). It is on the longer side, but that length is justified for a code-generation tool with this complexity.

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 tool with no output schema and minimal annotations, the description covers when to use it, prerequisites, required inputs, per-object-type behavior, and a quality caveat. Minor gaps remain: it doesn't state the delivery format of the generated code (returned in-chat vs. file creation) and the fourth parameter's semantics are left entirely to the schema. These are modest omissions against an otherwise thorough definition.

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 the baseline is 3. The description adds genuine value beyond the schema by elevating testScenarios to REQUIRED (overriding the schema's optional flag), clarifying that each scenario becomes a concrete test method with arrange/act/assert, and specifying which generated methods apply per object type. This is meaningful semantic enrichment rather than repetition.

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 and resource: 'Generate X++ SysTest unit test code for a CUSTOM D365 F&O object.' It also carves out a distinct scope by insisting on custom/extension code only, which separates it from sibling generators like generate_xpp_template, generate_xpp_form, and generate_data_entity. An agent can tell what this tool does and what it is not for.

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 gives explicit when-to-use context (WHEN: developer needs unit tests), concrete trigger phrases, and a hard constraint ('[!] Only meaningful on custom/extension code') that acts as a when-not on standard code. It misses explicit naming of an alternative sibling tool to route to, so it falls just short of full 5-level guidance.

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.