Files
insights/services/mcp/schema/exec-command-reference.md
zeekay 1b367e2b62 chore: rebase the tree onto upstream master
The tree was a debranded snapshot of upstream taken around 2026-02-20, and
upstream has moved about five months since. This replaces it with upstream
master, mechanically re-derived: bin/debrand does the rename, and the
pipeline and squashed migrations are restored from the shipped tree.

Not a merge. The previous import replaced the tree wholesale in a single
commit, so there is no shared content history to merge against. Reproducing
the rename on the new tree is what actually converges.

What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints,
compose files, LLM.md, and insights/migrations. The squashed initial
migration is load-bearing — the live database records it by name, so
upstream's ~918 individual migrations cannot come back.

Nine products are dropped as unreferenced. Twenty-one more that we do not run
are kept anyway because the core app still imports them; unpicking those is a
refactor and does not belong in a rebase.

This base does not build yet, and the reasons are not in the rename:
upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against
our 4.2, and the dependency manifests still name upstream packages that we
republish under our own names. Those are decisions, not renames.
2026-08-01 15:44:40 -07:00

2.8 KiB

CLI mode commands

In CLI mode, the default for most clients, the MCP server registers a single exec tool instead of one tool per endpoint. Agents pass it CLI-style command strings to list, search, inspect, and call the tools above on demand, which keeps context usage small.

learn <topic...> - load one or more learning topics
tools — list available tool names
search <regex_pattern> — search tools by JavaScript regex (matches name, title, description)
info [--json] <tool_name> — show tool name, description, and input schema (summarized if too large). Pass `--json` for raw JSON output.
schema <tool_name> [field_path] — drill into a specific field schema (supports dot-notation, e.g. series, breakdownFilter.breakdowns)
call [--json] [--confirm] <tool_name> <json_input> — call a tool with JSON input (--json returns JSON instead of optimized output in supported tools. Informational responses remain tagged and escaped in both MCP and the agent CLI. --confirm is required by the CLI for destructive tools.)

Namespaced references (insights:<tool-name>): strip the insights: prefix and route through exec. Run info <name> to inspect, then call <name> <json>. E.g. insights:insights-list → insights:exec({ "command": "info insights-list" }) then insights:exec({ "command": "call insights-list {}" }). If the bare name isn't found, fall back to search <pattern> — it may have been renamed.

The learn command is only registered on hosts that use the guided help catalog (currently Claude web and desktop). On hosts that support MCP apps, CLI mode also registers a separate render-ui tool for rendering interactive visualizations.

How agents use these commands

# 1. Find unknown tools
insights:exec({ "command": "search <regex>" })
insights:exec({ "command": "tools" })            # fallback: list all

# 2. Inspect once if the schema is missing
insights:exec({ "command": "info <tool_name>" })

# 3. Drill into complex fields — REQUIRED for any field with a `hint`
insights:exec({ "command": "schema <tool_name> <field_path>" })

# 4. Call; reuse the schema
insights:exec({ "command": "call <tool_name> <json_input>" })
insights:exec({ "command": "call --json <tool_name> <json_input>" })

Tips

  • Run info <tool_name> once when a schema isn't already in context, then reuse it. Running it before every call wastes context, and guessing a schema instead fails the call.
  • When info returns fields carrying a hint, drill into each one with schema <tool_name> <field_path> before building that field's value.
  • search matches tool names, titles, and descriptions, not input schemas. Search for the tool, then inspect its schema.