Test Tools
When to Use
Operator asks to smoke-test, regression-test, or audit every tool in the bot’s ToolSet.
Prerequisites
- Forgentic chat with a bot whose ToolSet includes the tools under test
spawnAgentandcheckAgentJobon the orchestrator bot (required — each tool group runs in its own sub-agent convo)toolSearch,loadTool, andunloadToolin ToolSet when deferred tools are includedforge-filesystemin ToolSet when testing filesystem MCP toolsplaywrightin ToolSet when testing browser MCP tools (always exercised when present)- High
maxStepson the orchestrator and worker bots (100+) - Operator available to answer
ask*QuestionUI tools once if those groups are included - Continuation bot (
botGroup+botHandle) whenswitchAgentis in the ToolSet
Procedure
Orchestrator (this convo)
-
Prepare run — set
runIdto UTCYYYY-MM-DD-HH-mm-ss,sandboxPrefixtotool-test-{runId},tempDirto.tool-test/{runId}/,reportIdentifierto{sandboxPrefix}-report,reportPathtoForge/Output/Tool_Test_{runId}.md. Use these for all inputs and created entities. Create the report file immediately inForge/Outputusing the header from references/report-template.md (with{runId},{sandboxPrefix}substituted, and0 pass, 0 fail, 0 skipas placeholder counts). This ensures results survive a crash. -
Discover tools — build
pending[]:- Add every eager tool in the session tool list.
- For each deferred group/server:
toolSearchwithmaxResults: 50and querieslist,search,read,create; collect uniquetoolKeyvalues intopending[]— do not callloadToolhere.
-
Partition into groups — assign each tool in
pending[]to exactly one group (skip groups with zero tools):Group id Tools meta-deferredtoolSearch,loadTool,unloadToolnative-readonlysearch*,find*,read*(except convo read used only after trash)native-mutatingcreate*,update*,trash*,restoreConvo, convo trash/restoremcp-readonlyforge-discovery__*,forge-typesense__*mcp-mutatingforge-filesystem__*,forge-bash__*playwrightplaywright__*uiartifacts,ask*Question,getWeather,searchTheWeb,extractWebPageexternalcomposio__*and other external MCP toolsagent-metaspawnAgent,checkAgentJob,abortAgentDo not include
switchAgentin any group — orchestrator handles it in step 7. -
Spawn workers — for each non-empty group, in table order:
spawnAgentwithmode: 'async', same bot as orchestrator,overrides.maxSteps: 100, and a message containing:groupId,runId,sandboxPrefix,tempDir,reportPath, the tool list for that group, and instruction to follow references/multi-test-cases.md + references/tool-categories.md for that group only.- Record
jobId+groupId. - Poll
checkAgentJobuntil terminal (completed,failed, oraborted) before spawning the next group — preserves create-before-search ordering acrossnative-mutatingand earlier read-only baselines. - On worker failure, append a
## Failuresnote for the group and continue with remaining groups.
The orchestrator does not call tools under test directly (except discovery in step 2). All tool smoke tests run in worker convos.
-
Finalize report — after all groups finish, read
reportPath, verify every tool inpending[]has a row (orSKIPwith reason). Add## Incompletefor any missing tools. -
Report —
artifactswithidentifier=reportIdentifier,type: text/markdown,display: panel. Body is the current content of the report file atreportPath. Summarize final counts in chat. -
switchAgent(last) — if in ToolSet, call last (after the report). Hand off to the continuation bot.reason: update artifact{reportIdentifier}with final status, summarize in chat, and stop — do not continue testing. Append theswitchAgentrow to the report file first.SKIPif no continuation bot is configured. -
Partial runs — if the orchestrator exhausts steps before all groups spawn or poll, update the report file with
## Incompletelisting remaining groups/tools, thenswitchAgentif available.
Worker (each sub-agent convo)
Test only the tools assigned in the spawn message — one tool (or variant) at a time:
- Per call: plan → call → assert (
countmatches array length on list/search tools) → cleanup → append row to report file (forge-filesystem__edit_fileonreportPath, adding a table row and updating summary counts) → log row. Retry once; thenFAILand continue. Every test result is persisted immediately — if the worker crashes, the report file already contains all results up to that point. - Multi-test: Tools with nested params, optional relations, list/search filters, MCP cycles, or agent job modes need extra variants — see references/multi-test-cases.md. Log each variant as its own row (
Tool (variant)). native-readonlygroup: pre-create empty baseline only.native-mutatinggroup: full CRUD chain; after creates, re-run applicablesearch*/find*/read*withsandboxPrefix(post-create path); complete todo chain; invoke everytrash*per multi-test-cases.playwrightgroup: one headless session; skipbrowser_screenshotandbrowser_pdf_save(logSKIP); call every otherplaywright__*tool on safe URLs.agent-metagroup: testspawnAgentsync,checkAgentJob, andabortAgenton jobs started in that worker convo only — do not respawn orchestrator workers.
Category rules: references/tool-categories.md.
Rules
- All names/handles/titles/queries of created database items use
sandboxPrefix; never update or trash non-prefixed entities except convo trash/restore (see multi-test-cases). - Convo trash/restore: use the oldest non-trashed convo in the DB (not the current convo); trash then restore it.
- Filesystem writes only under
tempDir; trash after test; use the sameworkspace_rootfor trash, list, and untrash. - Shell: read-only only (
pwd,ls,echo, simple pipes); norm,git push, installs. - Composio / external MCP: smallest read-only call; skip disconnected integrations.
- Playwright: test every in-ToolSet
playwright__*tool exceptbrowser_screenshotandbrowser_pdf_save(alwaysSKIPthose); safe URLs only (about:blank,https://example.com); end withbrowser_close. Never log in or hit production app URLs. - Call
switchAgentonly once, on the orchestrator, after the report (step 7); never mid-run. - One tool variant at a time per worker; no secrets or full file bodies in the report.
- Nested-object/array updates (
updatePrompt,updateBot,updateTodoList,updateBotPrompts): always run scalar and nested variants per references/multi-test-cases.md.