Skip to content

CLI is missing the MCP safety guards: expect_title, discard_unsaved, confirm_overwrite (and autoplay enabled, snapshot overwrite) #9

Description

@stanzhang

CONTRIBUTING lists "adding CLI commands that mirror existing MCP tool capabilities" as in scope, so this is a parity report rather than a complaint. I diffed every CLI subcommand's option set against the zod schema of the MCP tool it calls, then checked each candidate against --help to drop the ones the CLI takes positionally or under a different flag name (--max for max_trades, --filter for name_filter, --file for file_path, and so on — most of the apparent gaps are those).

What survives is small, and it has a pattern worth naming: three of the six are the safety guards on the most destructive operations, and they are unreachable from the CLI.

CLI command Missing MCP parameter Consequence
tv tab close expect_title closing a tab cannot be undone through the API, and the guard that names which tab is about to go exists only for MCP callers
tv layout switch discard_unsaved when a switch is stopped by unsaved changes, the error's own hint says to pass discard_unsaved:true, which the CLI cannot do
tv pine new, tv pine set confirm_overwrite same shape: _assertBufferSafeToReplace refuses and hints at confirm_overwrite:true, and the CLI never passes it. The fail-closed default is right, but from the CLI it is a dead end rather than a decision
tv replay autoplay enabled the CLI can only toggle. "Turn autoplay off" is not expressible — you have to read replay_status and infer whether to call it, which is the exact bug fixed on the MCP side in 2.3.0
tv state snapshot overwrite a snapshot name cannot be replaced from the CLI
tv alert create frequency, resolution on_bar_close alerts, and any resolution other than the 1 default, are MCP-only

The three hint-a-flag-that-does-not-exist cases are the ones I would prioritise. A CLI user follows the hint, finds no such option, and has no way to complete an action the tool explicitly offers.

tv replay autoplay is the one I hit hardest in practice: driving replay from a script means turning autoplay on, waiting, and turning it off, and the toggle makes the second half a guess.

Happy to send a PR — these look like handler-signature changes plus option declarations, no core changes. Say if you would rather have them as one PR or separately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions