1- #V06242026
1+ #V06252026
22# =============================================================================
33# PROJECT ANDREW – Tool Dispatcher
44# Intercepts LLM output for structured tool calls and routes them to the
@@ -431,8 +431,8 @@ def _dispatch_mcp(self, tool_name: str, attrs: Dict) -> str:
431431
432432 # Map tag names to (mcp_tool_name, required_arg)
433433 route_map = {
434- 'mcp_read' : ( 'read_file' , 'path' ),
435- 'mcp_list' : ( 'list_directory' , 'path' ),
434+ 'mcp_read' : None , # → os_control.read_file
435+ 'mcp_list' : None , # → os_control (not implemented, use powershell)
436436 'mcp_write' : ('write_file' , 'path' ),
437437 'mcp_search' : ('search_files' , 'path' ),
438438 'mcp_powershell' : ('powershell' , 'command' ),
@@ -450,6 +450,19 @@ def _dispatch_mcp(self, tool_name: str, attrs: Dict) -> str:
450450 if required_arg and required_arg not in mcp_args :
451451 return f'[TOOL RESULT] { tool_name } : missing required attr "{ required_arg } "'
452452
453+ # mcp_read
454+ if tool_name == 'mcp_read' :
455+ path = attrs .get ('path' , '' )
456+ controller = self ._get_controller ()
457+ if controller :
458+ return _handle_read_file ({'path' : path }, controller )
459+ return '[TOOL RESULT] mcp_read: os_control not available'
460+
461+ # mcp_list
462+ if tool_name == 'mcp_list' :
463+ cmd = f'Get-ChildItem "{ attrs .get ("path" , "C:/CAIOS" )} " | Select-Object Name'
464+ return _handle_mcp_win ({'command' : cmd }, 'mcp_powershell' )
465+
453466 # mcp_write needs content attr too
454467 if tool_name == 'mcp_write' and 'content' not in mcp_args :
455468 return '[TOOL RESULT] mcp_write: missing required attr "content"'
0 commit comments