Skip to main content
Glama

单元测试生成(按次计费)

testgen

为核心代码生成可运行的单元测试(自动 mock 外部依赖)。按次计费:业务成功才确认扣款,内容违规、模型超时或生成失败会自动全额退款。

Input Schema

NameRequiredDescriptionDefault
codeYes被测代码,最多 20000 字符。
languageNo代码语言,不填则自动判断。
frameworkNo测试框架,按语言可选:python=[pytest|unittest],javascript=[jest|vitest|mocha],typescript=[jest|vitest],java=[junit5|testng],go=[gotest],rust=[cargo-test],csharp=[xunit|nunit],php=[phpunit]
requestIdNo幂等键。同一次业务重试时复用同一个值,可避免重复扣费。

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.5/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 behavioral burden. It discloses the pay-per-use billing model and refund conditions, and mentions automatic mocking of external dependencies. However, it omits other behavioral details such as output format, data handling, or runtime expectations, leaving significant gaps for a creation tool.

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?

Two sentences, each earning its place: the first states the core function and key feature (mocking), and the second explains the billing model. It is front-loaded and free of waste.

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

Completeness3/5

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

For a generation tool with no output schema and no annotations, the description covers purpose and billing but is thin on other behavioral aspects like return format, performance expectations, or security/privacy. It is minimally adequate but not fully informative.

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 all four parameters are fully documented in the schema. The description adds no parameter-level semantics beyond what the schema provides; its billing note is behavioral, not parameter-specific. Baseline 3 applies.

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: '生成可运行的单元测试' for '核心代码', plus the automatic mocking of external dependencies. This distinguishes it from a general code generator like codegen, though it does not explicitly name sibling alternatives.

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?

The intended use is implied by the verb and resource: generating tests for core code. However, there is no explicit guidance on when to use this vs. codegen or other generation tools, nor any exclusions or prerequisites.

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.