Skip to main content
Glama

generate_xunit_test

Generate an xUnit (C#) test class: real assertions from {input, expected|throws} cases, skipped facts for described cases

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "className": "<className>",
      "methodName": "<methodName>"
    },
    "name": "generate_xunit_test"
  }
}

Input Schema

NameRequiredDescriptionDefault
classNameYes
namespaceNoC# namespace (default App.Tests)
testCasesNoTest cases. Either a description string (generated as a pending test) or {name, input: [args...], expected} / {name, input, throws: true | "message"} for a real assertion.
methodNameYes
mockFrameworkNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / namespace
      Added value: +{
      +  "description": "C# namespace (default App.Tests)",
      +  "type": "string"
      +}
    • addedInput schema / properties / testCases / description
      Added value: +"Test cases. Either a description string (generated as a pending test) or {name, input: [args...], expected} / {name, input, throws: true | \"message\"} for a real assertion."
    • addedInput schema / properties / testCases / items / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "properties": {
      +      "expected": {
      +        "description": "Expected return value (deep equality)"
      +      },
      +      "input": {
      +        "description": "Arguments (array) or a single argument"
      +      },
      +      "name": {
      +        "type": "string"
      +      },
      +      "throws": {
      +        "description": "true, or a substring of the expected error message"
      +      }
      +    },
      +    "required": [
      +      "name"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedInput schema / properties / testCases / items / type
      Removed value: -"string"
  2. First observed

TDQS

B3.1/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It does disclose meaningful behavior beyond the schema: object-form cases yield real assertions while plain-string cases become pending/skipped facts. However, it never says whether the generated class is written to disk or returned as text, nor whether an existing file is overwritten — a critical unknown for a code generator.

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?

A single front-loaded sentence that packs framework, language, and the two output modes with essentially no waste. The density makes it slightly cryptic for anyone unfamiliar with the {input, expected|throws} shorthand, but nothing is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With five parameters, no annotations, and no output schema, the description should do more: it leaves the return-vs-write question and the mockFramework behavior entirely unaddressed. An agent can form the call, but cannot predict the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 40%, so the description needs to compensate, and it partially does for testCases (both shapes and what they produce). But mockFramework (with enum moq/nsubstitute/none) is never mentioned in the description, leaving the agent to guess whether it controls mock generation, namespace defaults, or file content; className/methodName are also unexplained beyond the obvious.

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 and resource ('Generate an xUnit (C#) test class') and distinguishes itself from the many sibling generators by naming the exact framework and language. It doesn't explicitly contrast with other C#-adjacent generators, but the framework specificity does most of the disambiguation work.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: 'from {input, expected|throws} cases' and 'skipped facts for described cases' tells the agent which input shape produces which output, which is useful. There is no statement of when to prefer this tool over another generator or any prerequisite/exclusion, so the guidance stops at the input-mode level.

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.