Skip to main content
Glama

auto_generate_tests

Analyze a URL to detect modules and generate pytest tests for each module from candidate test cases. Provides quick coverage for any web application.

Instructions

一鍵交付:在內部依序做 analyze_url → 為每個偵測到的 module 用 candidate_tcs 內容各跑一次 generate_test,把整套 pytest 測試骨架寫進 PROJECT_ROOT/tests/。等同於『analyze_url 後對每個 module 手動跑 N 次 generate_test』的自動化版本,適合「給我一個 URL、其他你看著辦」這種快速覆蓋場景。每條 candidate_tc 變成對應 test 函式的 docstring,run_tests 跑完 HTML 報告會用 docstring 當 case 名稱顯示。回傳產生的檔案路徑列表 + 每個 module 對應幾個 test。預設每個 module 1 條,想要更密的覆蓋拉 tests_per_module。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes要分析並批次產測的 URL,需含 protocol(http:// 或 https://)。
timeout_msNo選填,analyze_url 內部 page.goto 等 DOMContentLoaded 的逾時毫秒。預設 15000,慢站可拉到 30000+。
auth_cookieNo選填,登入後分析所需 cookie,格式:`name1=value1; name2=value2`。從 DevTools / Application / Cookies 抓現成值貼進來。
tests_per_moduleNo選填,每個 module 從 candidate_tcs 取前 N 條各產一條 test。1-10,預設 1(最少噪音)。想要更密的覆蓋拉 3-5;拉到 10 通常會產 garbage tests,因為 candidate_tcs 後段是泛例。
Behavior4/5

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

With no annotations, the description details the internal sequence: analyze_url, then generate_test per module using candidate_tcs, and write to tests/. It warns about garbage tests at high tests_per_module, but does not specify if files are overwritten. Overall transparent.

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?

The description is a single dense paragraph. It contains useful details but could be better organized with bullet points or shorter sentences for readability.

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

Completeness4/5

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

Given no output schema, the description explains the return value (list of file paths and test counts per module). It covers all inputs and the core process, making it sufficiently complete for a high-level automation tool.

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

Parameters4/5

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

Schema coverage is 100%, with descriptions for all 4 parameters. The description adds extra context, e.g., explaining the effect of tests_per_module and source of auth_cookie, which aids parameter selection.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool automates analyze_url and generate_test per module, writing pytest files to PROJECT_ROOT/tests/. It clearly differentiates from siblings like analyze_url and generate_test by describing the automated pipeline.

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

Usage Guidelines4/5

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

The description mentions the tool is suitable for quick coverage scenarios ('給我一個 URL、其他你看著辦') and implies it automates manual steps. It does not explicitly state when not to use it, but the context effectively guides usage.

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/kao273183/mk-qa-master'

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