Skip to main content
Glama

generate-tests

Generate API test cases from Java, JavaScript, or TypeScript code for JUnit, Jest, or Mocha, so you can validate API behavior without writing tests manually.

Instructions

生成API测试用例

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": {
      "code": "<code>",
      "language": "<language>"
    },
    "name": "generate-tests"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesAPI代码内容
languageYes编程语言
testFrameworkNo测试框架junit

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.6/5.0
Behavior1/5

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

No annotations are supplied, so the description has the full burden of disclosing behavior, and it discloses nothing. It says nothing about whether generated tests are written to disk or only returned, whether code is analyzed statically, what happens with unsupported or malformed API code, or whether execution is required.

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

Conciseness3/5

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

It is a single front-loaded phrase with no wasted wording, but that is under-specification rather than true conciseness. Nothing is structured beyond the bare purpose statement.

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 tool that turns API code into tests, a gap remains: with no annotations and no output schema, the description should explain the returned artifact, how the framework parameter affects output, and any constraints. The description covers none of this, so it is incomplete for 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 100% and all three parameters, including two enums and the junit default, are documented in the schema. The description adds no meaning beyond that, so it meets the baseline of 3 for a well-documented schema.

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?

"生成API测试用例" states a concrete verb (generate) and resource (API test cases), so an agent can tell what the tool produces. It does not distinguish itself from siblings such as generate-openapi or validate-api, and it never says whether the output is source-code tests or a case list, so it falls short of a 5.

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 guidance on when to use this tool, when not to, or how it differs from generate-openapi and validate-api. The agent must infer the intended workflow entirely from the name and schema.

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

Deploy Server

Other Tools