Skip to main content
Glama
milhous

foundry-sandbox-mcp

by milhous

forge_test

Run Foundry tests in isolated Docker containers with automatic dependency installation and cleanup. Ensures a fresh environment for each test run.

Instructions

在 Docker 容器中运行 forge test 命令。每次测试时创建新容器,测试完成后自动清理,确保全新环境。运行测试前会根据依赖清单文件自动安装依赖。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
extraArgsNo额外的 forge test 参数
enablePruneNo是否在测试完成后执行 docker system prune -f,默认为 false(安全模式)
projectRootYes项目根路径(绝对路径),用于 Docker 挂载。例如 '/path/to/project'
testFolderPathYes测试合约文件夹路径(相对项目根路径)。例如 'test' 或 'test/unit'。如果路径以 .sol 结尾,则直接使用该路径;否则会自动匹配该文件夹下的所有 .t.sol 文件。
dependenciesManifestPathYes依赖项清单文件路径(相对项目根路径)。文件格式为 JSON 对象,例如 'dependencies.json'。支持两种格式:1) 数组格式(不带版本号):["package-name"] - 使用最新版本;2) 对象格式(带版本号):{"package-name": "version"} - 指定版本。内容示例:{ "forge": ["foundry-rs/forge-std"], "npm": {"@openzeppelin/contracts": "^5.0.2"}, "yarn": ["@chainlink/contracts"] }。forge、npm 和 yarn 字段都是可选的,但至少需要提供一个字段。每个字段可以独立选择使用数组或对象格式。
Behavior4/5

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

With no annotations, the description fully discloses key behaviors: ephemeral containers, automatic cleanup, and dependency installation. However, it does not mention error handling, output behavior, or potential side effects.

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?

The description is concise with three sentences, each adding essential information. It is front-loaded with the main action and key traits.

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?

The description provides context about the Docker environment and lifecycle, but lacks details on return values or failure scenarios. Given the complexity of parameters and no output schema, more completeness would improve usability.

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?

All parameters are described in the schema (100% coverage), so baseline is 3. The description adds minimal extra context beyond the schema, mainly stating that dependencies are installed automatically.

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 clearly specifies the action ('run forge test command') and the resource ('in a Docker container'), with key behavioral details like creating a new container each time and automatic cleanup. This provides a precise and distinct purpose.

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 implies usage for running forge tests in a Docker environment with fresh setup, but does not provide explicit guidance on when to use this tool versus alternatives (though no siblings are listed) or any exclusions.

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/milhous/foundry-sandbox-mcp'

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