thv_mcp_call.md

May 29, 2026 ยท View on GitHub

thv mcp call

Invoke a tool on an MCP server

Synopsis

Invoke a tool on an MCP server. The server is connected, initialized, the tool is called with the supplied arguments, and the result is printed.

Arguments are supplied as a JSON object via --args or --args-file. If neither flag is set, the tool is called with an empty argument object.

By default, the command exits with a non-zero status when the tool reports an error (CallToolResult.IsError=true). Use --ignore-tool-error to exit zero in that case; transport and protocol failures always exit non-zero.

thv mcp call <tool-name> [flags]

Options

      --args string         Tool arguments as a JSON object literal
      --args-file string    Path to a file containing a JSON object of tool arguments (use '-' to read from stdin)
      --format string       Output format (json, text) (default "text")
  -h, --help                help for call
      --ignore-tool-error   Exit zero even when the tool reports an error (default is non-zero)
      --server string       MCP server URL or name from ToolHive registry (required)
      --timeout duration    Connection timeout (default 30s)
      --transport string    Transport type (auto, sse, streamable-http) (default "auto")

Options inherited from parent commands

      --debug   Enable debug mode

SEE ALSO

  • thv mcp - Interact with MCP servers for debugging