Skip to main content
Glama

ask_chatgpt_tool

Send prompts to ChatGPT via the MCP server to receive AI-generated responses, enabling integration with MCP-compatible assistants for dynamic interactions.

Instructions

Send a prompt to ChatGPT and return the response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes

Implementation Reference

  • The handler function for the 'ask_chatgpt_tool' MCP tool. It is decorated with @mcp.tool() which registers it with the FastMCP server and delegates the logic to the ask_chatgpt helper function.
    @mcp.tool()
    async def ask_chatgpt_tool(prompt: str) -> str:
        """Send a prompt to ChatGPT and return the response."""
        return await ask_chatgpt(prompt)
  • The core helper function that implements the logic for sending a prompt to ChatGPT via AppleScript automation on macOS, cleaning the prompt, activating the app, sending keystrokes, waiting for response, and retrieving it.
    async def ask_chatgpt(prompt: str) -> str:
        """Send a prompt to ChatGPT and return the response.
        
        Args:
            prompt: The text to send to ChatGPT
        
        Returns:
            ChatGPT's response
        """
        await check_chatgpt_access()
        
        try:
            # 프롬프트에서 개행 문자 제거 및 더블쿼츠를 싱글쿼츠로 변경
            cleaned_prompt = prompt.replace('\n', ' ').replace('\r', ' ').replace('"', "'").strip()
            
            # Activate ChatGPT and send message using keystroke
            automation = ChatGPTAutomation()
            automation.activate_chatgpt()
            automation.send_message_with_keystroke(cleaned_prompt)
            
            # Get the response
            response = await get_chatgpt_response()
            return response
            
        except Exception as e:
            raise Exception(f"Failed to send message to ChatGPT: {str(e)}")
  • The FastMCP server instance is created and setup_mcp_tools is called to register all tools, including ask_chatgpt_tool.
    mcp = FastMCP("chatgpt")
    
    # Setup MCP tools
    setup_mcp_tools(mcp)
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 mentions sending a prompt and returning a response but omits critical details like authentication needs, rate limits, response format, error handling, or whether it starts a new chat versus continues an existing one. This is inadequate for a tool that interacts with an external service.

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 with no wasted words, making it highly concise and front-loaded. Every part of the sentence contributes directly to explaining the tool's function.

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 complexity of interacting with ChatGPT (an external AI service), no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on behavior, parameters, and output, making it insufficient for an agent to use the tool effectively without guesswork.

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

Parameters3/5

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

The description implies a 'prompt' parameter but doesn't add meaning beyond the input schema, which has 0% description coverage and only specifies the parameter name and type. Since there's only one parameter, the baseline is 4, but the description fails to compensate for the schema's lack of details (e.g., prompt format, length limits), so it scores lower.

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 ('Send a prompt') and target ('to ChatGPT') with the outcome ('return the response'), making the purpose understandable. However, it doesn't distinguish this tool from its siblings (get_chatgpt_response_tool, new_chatgpt_chat_tool), which likely have overlapping or related functionality, preventing a score of 5.

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?

The description provides no guidance on when to use this tool versus its siblings (get_chatgpt_response_tool, new_chatgpt_chat_tool), nor does it mention any prerequisites, context, or exclusions. This lack of differentiation leaves usage unclear.

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