How to Resolve MCP Error -32602 with OpenAI Integration on Pipedream Connect with Gmail App?

This topic was automatically generated from Slack. You can find the original thread here.

Hi Team,
I’m integrating with Pipedream connect where an user was connected successfully to gmail app. And when I tried using it through openai, I’m getting below errors: MCP error -32602: Tool configure_component not found, MCP error -32602: Tool begin_configuration_gmail-find-email not found. Pasting the piece of code in the thread . Any help in fixing this or pointers would be really helpful. Thanks!!

response = openai_client.responses.parse(
    model='gpt-4o-mini',
    instructions= system_prompt,
    tools=[
        {
            "type": "mcp",
            "server_label": app_slug,
            "server_url": f"https://remote.mcp.pipedream.net",
            "headers": {
                "Authorization": f"Bearer {access_token}",
                "x-pd-project-id": "proj_XXXXX",
                "x-pd-environment": "development",
                "x-pd-external-user-id": external_user_id,
                "x-pd-app-slug": app_slug,
                "x-pd-app-discovery": "true",
                "x-pd-tool-mode": "full-config",
            },
            "require_approval": "never"
        }
    ],
    input=[
        Message(
            role="user",
            content=[
                ResponseInputTextParam(
                    type = "input_text",
                    text= "Fetch my emails from the last 2 days and find insights about it."
                )
            ]
        ),
    ],
    max_tool_calls=3,
    text_format=EmailInsights,
)

Are you reloading the list of available tools?

How do i do that ? I see that its mentioned here to reload the tools .
Should i make the same request again with a conversation_id so that pipedream will determine that ?

Yea give that a try — you can also check out the OpenAI example here, which demonstrates that reloading (though I think the example needs to be updated to use their Responses API instead of Completions): pipedream-connect-examples/mcp at master · PipedreamHQ/pipedream-connect-examples · GitHub

Got it. This makes sense and we are manually handling all tool calling. But in my use case, I’m letting the openai itself automatically chose the tool and execute it. And i want a control on what tools should be gone to openai, is there anyway to do it ?

Like I have a usecase of only reading emails , reading user profile. Is there anyway that i can show only these two tools to LLM and process my query ? Without bloating up my context.