Skip to main content
Glama

forge_test

Runs Foundry project tests with filters for test name, contract, and path; supports live-network forking and gas reports.

Instructions

Run tests in a Foundry project (forge test). Supports filtering by test name, contract, and path. Can fork from a live network and generate gas reports.

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": {
      "projectPath": "<projectPath>"
    },
    "name": "forge_test"
  }
}

Input Schema

NameRequiredDescriptionDefault
filterNoTest function name filter (--match-test)
forkUrlNoRPC URL to fork from for tests
profileNoFoundry profile to use (maps to FOUNDRY_PROFILE env var)
gasReportNoInclude gas usage report in output
verbosityNoVerbosity level 0-5 (maps to -v, -vv, etc.)
pathFilterNoPath filter (--match-path)
projectPathYesAbsolute path to the foundry project directory
contractFilterNoContract name filter (--match-contract)
forkBlockNumberNoBlock number to fork from (requires forkUrl)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden and falls short. It never says whether a failing test surfaces as an error or a normal result, whether the run mutates the workspace (build artifacts, cache), how long-running or blocking the call is, or what the output looks like. The fork and gas-report notes are capability statements, not behavioral traits such as auth/RPC requirements or rate limits.

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?

Three short sentences, front-loaded with the core action, no filler or hedging. Sentences two and three partly restate what the schema already documents, which is minor redundancy rather than bloat.

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 9-parameter tool with no annotations and no output schema, the definition covers what the tool does but not what it returns or how failures manifest, which is the main thing an agent needs before invoking an executor. It is adequate but leaves real gaps that neither schema nor annotations fill.

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?

With 100% schema description coverage across 9 parameters, the schema already explains each flag and its CLI mapping, so the baseline is 3. The description's mention of filtering by test name, contract, and path plus forking and gas reports mirrors schema content without adding constraints, defaults, or interactions (e.g., forkBlockNumber requiring forkUrl is only in 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 states a specific verb and resource ('Run tests in a Foundry project') and even maps it to the underlying CLI ('forge test'), so an agent knows exactly what happens. It also enumerates the three filtering axes and two optional capabilities (forking, gas reports). It does not explicitly distinguish itself from near-neighbors like forge_coverage or forge_snapshot, which is the only thing keeping it from 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 Guidelines3/5

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

Usage is implied rather than stated: the reader can infer this is the tool for executing a test suite, and the mention of gas reports hints at an overlap with forge_snapshot/forge_coverage that is never resolved. There are no when-not conditions, no prerequisites (e.g., project must be built first), and no guidance on choosing between this and the coverage/snapshot siblings.

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