Skip to main content
Glama

new_chatgpt_chat_tool

Initiate a fresh chat conversation with ChatGPT through the MCP server, enabling prompt interactions from any compatible AI assistant.

Instructions

Start a new chat conversation in ChatGPT.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'new_chatgpt_chat_tool'. Decorated with @mcp.tool() for registration and executes the tool logic by delegating to the new_chatgpt_chat helper function.
    @mcp.tool()
    async def new_chatgpt_chat_tool() -> str:
        """Start a new chat conversation in ChatGPT."""
        return await new_chatgpt_chat()
  • Helper function implementing the core logic for starting a new ChatGPT chat. Checks access, creates ChatGPTAutomation instance, calls new_chat(), and handles the result.
    async def new_chatgpt_chat() -> str:
        """Start a new chat conversation in ChatGPT.
        
        Returns:
            Success message or error
        """
        await check_chatgpt_access()
        
        try:
            automation = ChatGPTAutomation()
            result = automation.new_chat()
            
            if isinstance(result, tuple):
                success, method = result
                if success:
                    return f"Successfully opened a new ChatGPT chat window using: {method}"
                else:
                    return f"Failed to open a new chat window. Last tried method: {method}"
            else:
                # 이전 버전과의 호환성
                if result:
                    return "Successfully opened a new ChatGPT chat window."
                else:
                    return "Failed to open a new chat window. Please check if ChatGPT window is in the foreground."
                
        except Exception as e:
            raise Exception(f"Failed to create new chat: {str(e)}")
  • Core automation helper in ChatGPTAutomation class. Uses AppleScript via subprocess to attempt opening new chat via English menu, Korean menu, or Cmd+N shortcut, returning success status and method used.
    def new_chat(self):
        """새 ChatGPT 채팅창 열기"""
        # ChatGPT 앱을 활성화
        self.activate_chatgpt()
        
        # 메뉴를 통해 새 채팅 열기 시도
        script = '''
        tell application "System Events"
            tell process "ChatGPT"
                try
                    -- 메뉴바에서 File > New Chat 클릭
                    click menu item "New Chat" of menu "File" of menu bar 1
                    return "success_menu"
                on error
                    try
                        -- 한국어 메뉴 시도
                        click menu item "새 채팅" of menu "파일" of menu bar 1
                        return "success_menu_kr"
                    on error
                        -- 그래도 안되면 Cmd+N 시도
                        keystroke "n" using {command down}
                        return "success_shortcut"
                    end try
                end try
            end tell
        end tell
        '''
        
        result = subprocess.run(['osascript', '-e', script], capture_output=True, text=True)
        time.sleep(0.5)  # 새 채팅창이 열릴 때까지 대기
        
        # 디버깅을 위한 출력
        print(f"[DEBUG] new_chat result: returncode={result.returncode}, stdout='{result.stdout}', stderr='{result.stderr}'")
        
        # 성공 여부와 사용된 방법 반환
        if result.returncode == 0 and result.stdout.strip():
            method = result.stdout.strip()
            if method == "success_menu":
                return (True, "File > New Chat menu")
            elif method == "success_menu_kr":
                return (True, "파일 > 새 채팅 메뉴")
            elif method == "success_shortcut":
                return (True, "Cmd+N shortcut")
        
        return (False, "unknown")
  • The setup_mcp_tools function defines and registers all MCP tools including new_chatgpt_chat_tool using the @mcp.tool() decorator.
    def setup_mcp_tools(mcp: FastMCP):
        """MCP 도구들을 설정"""
        
        @mcp.tool()
        async def ask_chatgpt_tool(prompt: str) -> str:
            """Send a prompt to ChatGPT and return the response."""
            return await ask_chatgpt(prompt)
    
        @mcp.tool()
        async def get_chatgpt_response_tool() -> str:
            """Get the latest response from ChatGPT after sending a message."""
            return await get_chatgpt_response()
        
        @mcp.tool()
        async def new_chatgpt_chat_tool() -> str:
            """Start a new chat conversation in ChatGPT."""
            return await new_chatgpt_chat()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool starts a new chat, implying a write operation, but doesn't cover aspects like whether this requires authentication, what happens to existing chats, or the expected outcome (e.g., does it return a chat ID?). This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and efficiently communicates the core function, making it easy for an agent to parse and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no annotations, no output schema, and 0 parameters, the description is minimal. While concise, it lacks details on behavioral traits (e.g., mutation effects, return values) and doesn't help differentiate from siblings. For a tool that likely creates a resource, more context on outcomes or usage would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and the input schema has 100% description coverage (though empty). The description doesn't need to add parameter details, so it appropriately avoids redundancy. A baseline of 4 is applied since no parameters exist, and the description doesn't attempt to explain non-existent inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Start') and resource ('a new chat conversation in ChatGPT'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'ask_chatgpt_tool' or 'get_chatgpt_response_tool', which likely involve interacting with existing conversations rather than creating new ones.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus the sibling tools. The description implies it's for initiating conversations, but there's no explicit mention of alternatives or context for choosing this over other tools, leaving the agent to infer usage based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xncbf/chatgpt-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server