async def _stdio_register_tools(self, llm) -> ToolsSchema:
        """Register all available mcp.run tools with the LLM service.
        Args:
            llm: The Pipecat LLM service to register tools with
        Returns:
            A ToolsSchema containing all registered tools
        """

        async def mcp_tool_wrapper(
            function_name: str,
            tool_call_id: str,
            arguments: Dict[str, Any],
            llm: any,
            context: any,
            result_callback: any,
        ) -> None:
            """Wrapper for mcp.run tool calls to match Pipecat's function call interface."""
            logger.debug(f"Executing tool '{function_name}' with call ID: {tool_call_id}")
            logger.trace(f"Tool arguments: {json.dumps(arguments, indent=2)}")
            try:
                async with self._client(self._server_params) as streams:
                    async with self._session(streams[0], streams[1]) as session:
                        await session.initialize()
                        await self._call_tool(session, function_name, arguments, result_callback)
            except Exception as e:
                error_msg = f"Error calling mcp tool {function_name}: {str(e)}"
                logger.error(error_msg)
                logger.exception("Full exception details:")
                await result_callback(error_msg)

        logger.debug("Starting registration of mcp.run tools")

        async with self._client(self._server_params) as streams:
            async with self._session(streams[0], streams[1]) as session:
                await session.initialize()
                tools_schema = await self._list_tools(session, mcp_tool_wrapper, llm)
                return tools_schema
Register all available mcp.run tools with the LLM service.
        Args:
            llm: The Pipecat LLM service to register tools with
        Returns:
            A ToolsSchema containing all registered tools
        
src/pipecat/services/mcp_service.py