Gmail MCP Error -32603: Tool execution failed

4/6/2026 update:

The problem fixed itself today when I rerun. Thank you.





Below is the original post:

I receive many newsletter subscriptions that I don’t have time to read. To manage this, I created an agent in Fleet to summarize each newsletter into a single sentence. The agent worked perfectly for a few days, but earlier this week, it began encountering a Gmail connection error.

Although I haven’t changed the code or settings, I keep receiving the following error: "MCP Error -32603: Tool execution failed: Agent auth failed: HTTP 400: {"detail":"Unknown provider: google-langsmith-prod"}".

Because the agent can no longer connect to my mailbox, it cannot read the incoming emails. I have attempted the following troubleshooting steps without success:

  1. Reconnecting Gmail in Fleet Integrations: I tried this multiple times, and although it confirms the connection is successful, the error persists.

  2. Debugging via Agent Session: I pasted Gemini’s debugging proposals into the agent’s edit session and asked it to verify its tools and code, but the issue remains.

  3. Reviewing Prompts and Toolboxes: I verified that the procedures are clearly stated in the agent’s instructions and confirmed that the toolbox contains all necessary Gmail tools.

Below are the code for the extract.pyand tools.json

import json
import re
from bs4 import BeautifulSoup

def clean_html(html_content):
    soup = BeautifulSoup(html_content, 'html.parser')
    text = soup.get_text(separator=' ', strip=True)
    # clean up multiple spaces
    text = re.sub(r'\s+', ' ', text)
    return text

def extract_links(html_content):
    soup = BeautifulSoup(html_content, 'html.parser')
    links = []
    for a in soup.find_all('a', href=True):
        href = a['href']
        # basic heuristic for news article links
        if 'facebook.com' in href or 'twitter.com' in href or 'instagram.com' in href or 'youtube.com' in href:
            continue
        if 'unsubscribe' in href.lower() or 'privacy' in href.lower() or 'terms' in href.lower():
            continue
        if 'liveintent' in href or 'cmail20.com' in href:
            continue
        if href.startswith('http'):
            links.append(href)
    
    # remove duplicates while preserving order
    seen = set()
    unique_links = []
    for link in links:
        # For SF chronicle, they use tracking links. We just keep them if they are unique.
        if link not in seen:
            seen.add(link)
            unique_links.append(link)
            
    return unique_links[:10]

def main():
    file_path = '/large_tool_results/xxx'
    output_path = '/memories/extracted_news_content.json'
    
    with open(file_path, 'r', encoding='utf-8') as f:
        emails = json.load(f)
        
    target_subjects = [
        "The Morning: Confronting the chaos",
        "The 10-Point: A First Lady",
        "This Tahoe town is losing the fight against",
        "Tahoe town’s losing battle"
    ]
    
    results = []
    
    for email in emails:
        subject = email.get('subject', '')
        if any(ts in subject for ts in target_subjects):
            body = email.get('body', '')
            cleaned_text = clean_html(body)
            body_text = cleaned_text[:2500]
            top_links = extract_links(body)
            
            results.append({
                "subject": subject,
                "body_text": body_text,
                "top_links": top_links
            })
            
    with open(output_path, 'w', encoding='utf-8') as f:
        json.dump(results, f, indent=2)

if __name__ == '__main__':
    main()
```
{
  "tools": [
    {
      "name": "notion-search",
      "mcp_server_url": "https://mcp.notion.com/mcp",
      "mcp_server_name": null,
      "display_name": "notion-search"
    },
    {
      "name": "notion-create-pages",
      "mcp_server_url": "https://mcp.notion.com/mcp",
      "mcp_server_name": null,
      "display_name": "notion-create-pages"
    },
    {
      "name": "notion-fetch",
      "mcp_server_url": "https://mcp.notion.com/mcp",
      "mcp_server_name": null,
      "display_name": "notion-fetch"
    },
    {
      "name": "notion-update-page",
      "mcp_server_url": "https://mcp.notion.com/mcp",
      "mcp_server_name": null,
      "display_name": "notion-update-page"
    },
    {
      "name": "notion-move-pages",
      "mcp_server_url": "https://mcp.notion.com/mcp",
      "mcp_server_name": null,
      "display_name": "notion-move-pages"
    },
    {
      "name": "notion-create-database",
      "mcp_server_url": "https://mcp.notion.com/mcp",
      "mcp_server_name": null,
      "display_name": "notion-create-database"
    },
    {
      "name": "tavily_web_search",
      "mcp_server_url": "https://tools.langchain.com",
      "mcp_server_name": "Fleet",
      "display_name": "tavily_web_search"
    },
    {
      "name": "gmail_draft_email",
      "mcp_server_url": "https://tools.langchain.com",
      "mcp_server_name": "Fleet",
      "display_name": "gmail_draft_email"
    },
    {
      "name": "gmail_send_email",
      "mcp_server_url": "https://tools.langchain.com",
      "mcp_server_name": "Fleet",
      "display_name": "gmail_send_email"
    },
    {
      "name": "gmail_mark_as_read",
      "mcp_server_url": "https://tools.langchain.com",
      "mcp_server_name": "Fleet",
      "display_name": "gmail_mark_as_read"
    },
    {
      "name": "gmail_archive_email",
      "mcp_server_url": "https://tools.langchain.com",
      "mcp_server_name": "Fleet",
      "display_name": "gmail_archive_email"
    },
    {
      "name": "gmail_get_thread",
      "mcp_server_url": "https://tools.langchain.com",
      "mcp_server_name": "Fleet",
      "display_name": "gmail_get_thread"
    },
    {
      "name": "gmail_read_emails",
      "mcp_server_url": "https://tools.langchain.com",
      "mcp_server_name": "Fleet",
      "display_name": "gmail_read_emails"
    }
  ],
  "interrupt_config": {}
}
```