Skip to main content
Glama

gentest

Read-onlyIdempotent

Generates unit tests for code by analyzing source code or file paths, with support for Jest, Vitest, and Mocha frameworks.

Instructions

当用户需要为代码生成单元测试时使用。指南型工具:注入 code/file_path 与测试清单,由 Agent 生成完整测试代码;MCP 不自动生成或运行测试

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo要生成测试的代码。可以是函数、类或模块
file_pathNo要生成测试的源文件路径(相对 project_root 或绝对路径)。未传 code 时从磁盘读取
frameworkNo测试框架:jest、vitest、mocha。可选,会自动识别项目使用的框架
project_rootNo项目根目录绝对路径。配合 file_path 解析相对路径
Behavior3/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, indicating no side effects. The description adds that this is a 'guide-type tool' and that MCP does not automatically generate or run tests, which provides some additional behavioral context but does not contradict annotations.

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 concise (two sentences) and front-loaded with the key usage scenario. Each sentence serves a purpose, though the second sentence could be structured more clearly. Still, no filler.

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?

Given the 4 parameters and lack of output schema, the description explains when to use, what to provide, and what the agent does. However, it omits details about return values and does not clarify the 'test checklist' concept. It is adequate but has gaps.

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 coverage is 100%, so all parameters are documented. The description mentions '注入 code/file_path 与测试清单' but '测试清单' is not a parameter in the schema, potentially causing confusion. Overall, the description adds minimal meaning beyond the 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?

The description clearly states the tool is used for generating unit tests for code ('当用户需要为代码生成单元测试时使用'). It specifies the action (generate tests) and resource (code/file_path). While it doesn't explicitly distinguish from siblings, the purpose is distinct enough among the listed siblings.

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 description provides some usage guidance ('当用户需要为代码生成单元测试时使用', '指南型工具') and clarifies that MCP does not auto-generate or run tests. However, it lacks explicit when-not-to-use instructions or alternatives, making it only moderately helpful for decision-making.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mybolide/mcp-probe-kit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server