Skip to main content

make_tool_caller

Function make_tool_caller 

Source
pub fn make_tool_caller(
    signing_key: &SigningKey,
) -> Result<(ToolCaller, HashMap<String, String>, Vec<Value>)>
Expand description

Build a ToolCaller backed by the MCP ZMQ service.

Eagerly fetches the tool list so that tool_descriptions and openai_tools can be returned alongside the caller. If the MCP service is unreachable, returns empty collections and a caller that immediately sends an error result. A missing or blank TUI service credential is rejected before either operation is constructed, so neither production MCP path can fall back to tokenless RPC.

Returns (caller, descriptions, openai_tools) where:

  • descriptions maps UUID → human label (for TUI display)
  • openai_tools is the full OpenAI-format tool list for apply_chat_template