Tool Calling

MoMCP-TUI automatically detects when your message requires a tool and invokes the appropriate MCP server.

How It Works

  1. Tool discovery: On startup, MoMCP-TUI queries all configured MCP servers for available tools
  2. Tool definitions: Tool schemas are sent to the LLM as function definitions
  3. Intent detection: The LLM decides whether to answer directly or call a tool
  4. Execution: Tool calls are routed to the correct MCP server
  5. Result loop: Tool results are fed back to the LLM for final response generation

Tool Call Display

When a tool is invoked, you see a status panel:

┌─ Tool Call ──────────────────────────┐
│ [momcp/fs_list] Running...           │
│ → /Users/you/project                 │
└──────────────────────────────────────┘

After completion:

┌─ Tool Call ──────────────────────────┐
│ [momcp/fs_list] Done (234 chars)     │
│ → /Users/you/project                 │
└──────────────────────────────────────┘

Multi-Step Tool Calling

The LLM can call multiple tools in sequence (up to 12 iterations) to complete complex tasks:

User: "Create a Python project with main.py and a README"

LLM calls:
1. fs_mkdir(path="my-project")
2. fs_write(path="my-project/main.py", content="...")
3. fs_write(path="my-project/README.md", content="...")

Final response: "Done! Created project with main.py and README.md"