Unified tool layer

August 6, 2026 ยท View on GitHub

This page is the detailed reference for the Unified tools capability in Harnesses.

Unified tools let agents inspect, control, and coordinate the construct fleet. For example:

  • A review agent can read the implementer's diff before commenting.
  • A coordinator can spawn a shell session to run tests.
  • An agent can open a browser, inspect the page, and show the preview in the TUI.
  • A session can publish a status widget without knowing whether the user is in the TUI or Web UI.

Smith uses these tools natively. MCP-capable harnesses receive the same tools through the construct MCP server (construct __mcp), so they can coordinate the fleet without shelling out to ad-hoc construct CLI commands.

Shared tools are not shared write semantics. Two harnesses with the same injected tool set can still differ on who approves a file write and whether it is allowed at all โ€” construct gates tool calls natively in smith only, and every CLI-backed harness keeps its upstream CLI's own approval behavior. See Write access and approvals.

Using unified tools

There is usually nothing to configure. smith sees these tools natively. Claude Code and Codex receive them automatically via construct __mcp; set CONSTRUCT_INJECT_MCP=0 in the daemon environment to opt out.

Agents invoke these tools during tasks, just like their other tools. A quick way to verify injection is to ask a Claude or Codex session to list available construct sessions; it should be able to use agentd_list_sessions without running the construct CLI in a shell.

Harness support

HarnessUser-facing statusImplementation notes
SmithBuilt in.Uses the same tool set without an external MCP process.
Claude CodeEnabled by default.Adapter writes a config under CONSTRUCT_STATE_DIR and passes --mcp-config <path> pointing to construct __mcp.
CodexEnabled by default.Adapter passes Codex a -c mcp_servers.construct=... TOML override pointing to construct __mcp.
OpenCodeEnabled by default.Adapter merges a construct entry into the config content it hands the session, pointing at construct __mcp.
AntigravityNot injected yet.Receives CONSTRUCT_SESSION_ID; browser/tools can be injected once agy exposes an MCP config flag.
HermesNot injected yet.Hermes supports MCP in persistent config, but the adapter does not mutate user configuration; injection waits for a per-invocation config surface.
Grok, Kimi, pi, Prime AgentNot injected yet.These adapters receive CONSTRUCT_SESSION_ID but do not inject an MCP entry today.

Fleet-control tools

ToolPurpose
agentd_contextLoad the calling session's agentd context, including global/project memory, memory file paths, session widget paths, widget policy, and memory maintenance policy. Agents should call this before starting a user task. See Memory and Generative widgets.
agentd_whoamiReturn the current session id.
agentd_list_sessionsList sessions, status, cwd, pinned state, automode, and grouping metadata.
agentd_get_sessionFetch summary and structured transcript for one session.
agentd_get_transcriptFetch a slice of a session event log.
agentd_get_outputRead recent PTY scrollback.
agentd_get_diffRead git diff HEAD for the session worktree.
agentd_list_harnessesShow available harness adapters.
agentd_create_sessionSpawn a new session, optionally in an isolated worktree.
agentd_send_inputSend a line of text to a session.
agentd_send_keysSend raw PTY bytes, such as control keys.
agentd_interrupt_sessionInterrupt the active turn/process.
agentd_stop_sessionAsk a session to wind down cleanly.
agentd_kill_sessionKill a session immediately.
agentd_delete_sessionDelete a session and its stored transcript/worktree.
agentd_pin_sessionToggle the pinned flag.
agentd_rename_sessionSet a user-facing title.
agentd_set_session_groupMove a session into, out of, or within a group.
agentd_move_sessionReorder a session in the visible session list.
agentd_loop_create / agentd_loop_list / agentd_loop_update / agentd_loop_removeManage recurring prompts attached to sessions.

Browser tools

ToolPurpose
browser_openOpen a URL in Chrome through DevTools.
browser_inspectRead page title, URL, visible text, and links.
browser_screenshotCapture a tab screenshot and emit a TUI preview.
browser_evalEvaluate JavaScript for automation or DOM extraction.

Browser tools emit a BrowserPreview event back to the calling session, so the TUI thumbnail updates for MCP-capable harnesses the same way it does for smith-native browser calls.

Memory and session context

agentd_context is the high-level way for an agent to load its current context: global/project memory, memory file paths, session widget paths, widget policy, supported widget Markdown extensions, and memory maintenance policy.

The environment variables below are the low-level view of that same context. They are passed to child agents so tools know which daemon and session they belong to.

VariablePurpose
CONSTRUCT_SESSION_IDIdentifies the calling session, so tools can avoid acting on themselves.
CONSTRUCT_RUNTIME_DIR / CONSTRUCT_STATE_DIR / CONSTRUCT_DATA_DIR / CONSTRUCT_CONFIG_DIRPoint tools at the same daemon and storage layout as the parent session.
CONSTRUCT_GLOBAL_MEMORY_FILE / CONSTRUCT_PROJECT_MEMORY_FILE / CONSTRUCT_PROJECT_IDPoint agentd_context at the Markdown memory files for the session.
CONSTRUCT_SESSION_WIDGETS_DIRPoints agents at the current session's file-backed widget directory. Prefer reading it from agentd_context so the agent also sees widget policy and supported Markdown extensions.

Generative widgets

Agents can create session-scoped UI widgets by writing Markdown files into the session_widgets.dir returned by agentd_context. The same directory is also available as CONSTRUCT_SESSION_WIDGETS_DIR, but agentd_context is preferred because it includes widget policy and supported Markdown extensions. See Generative widgets for the file format, lifecycle, rendering behavior, and action-link semantics.