Skip to main content
Glama

generate_vitest_test

Generate a Vitest test suite: real assertions from {input, expected|throws} cases, pending it.todo for described cases, vi.mock support

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": {
      "functionName": "<functionName>",
      "modulePath": "<modulePath>"
    },
    "name": "generate_vitest_test"
  }
}

Input Schema

NameRequiredDescriptionDefault
asyncNo
mockDepsNo
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.
modulePathYes
functionNameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • 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?

With no annotations, the description carries the full burden. It usefully discloses the mapping behavior: {input, expected} produces a real assertion, string cases become pending it.todo, and mockDeps drives vi.mock. It does not say whether the suite is written to disk or returned as a string, nor whether existing files are overwritten.

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 dense sentence with a front-loaded purpose and a colon-delimited list of behaviors; nothing is wasted. It is packed with jargon ({input, expected|throws}) that an unfamiliar agent must decode from the schema, but there is no verbosity to trim.

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?

For a five-parameter code generator with no annotations and no output schema, the description leaves the return contract undefined — the agent cannot tell if a file is created or text is returned. It also never explains async, functionName, or modulePath, so it is incomplete relative to the tool's complexity.

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 low (20%), and the description only reinforces testCases semantics already documented in the schema and gestures at mockDeps via "vi.mock support". The four other parameters (functionName, modulePath, async, mockDeps) get no meaning from the description at all.

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?

Names a specific verb and resource ("Generate a Vitest test suite") and identifies the framework, which separates it from the Jest/Mocha/RTL siblings. It also states what the generated suite contains (real assertions, pending it.todo, vi.mock), so the output shape is clear without opening the schema.

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

Usage Guidelines2/5

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

There is no statement of when to choose this over generate_jest_test, generate_mocha_test, or generate_test_suite, and no prerequisites or exclusions. The only cue is the framework name embedded in the purpose line, which is inference rather than 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.