Yea it’s configured to be “Notion” in the app docs, something else to be passing?
Are you passing “Google Sheets” or “google_sheets” as the server_label with that latest example? That’s how I interpret that error from OpenAI.
Yeah for google_sheets it gives that error
The server label I’m retrieving directly from the apps returned
(Gmail in the await pd.getApps({ q: "Gmail" }); , not server label)
Yea that’s a mistake in our code example. Try just using appSlug as server_label instead of appName.
I see, I tried Notion with the new appSlug where it’s const appSlug = app.name_slug; but still getting the same error
Is there a way to get the app names I can pass here? I tried Gmail / Google Sheets but getting different errors for all of them
Hey FYI I can reproduce this issue on my end, so I’m looking into it. It seems like OpenAI just isn’t sending the actual tool calls, but I’m not sure the exact issue yet. Sorry for the trouble and thanks for your patience!
Thanks no worries, it’s an early product. Do let me know once fixed, we were looking to integrate something like this at our company
Hey Tejas, this is now working for me — can you give it another try on your end? I’m running this code:
import OpenAI from 'openai';
import { createBackendClient } from "@pipedream/sdk/server";
// Initialize the Pipedream SDK client
const pd = createBackendClient({
environment: PIPEDREAM_ENVIRONMENT,
credentials: {
clientId: PIPEDREAM_CLIENT_ID,
clientSecret: PIPEDREAM_CLIENT_SECRET,
},
projectId: PIPEDREAM_PROJECT_ID
});
// Find the app to use for the MCP server
// For this example, we'll use Notion
const apps = await pd.getApps({ q: "notion" });
const appSlug = apps.data[0].name_slug; // e.g., "notion",
const appLabel = apps.data[0].name; // e.g., "Notion"
// Get access token for MCP server auth
const accessToken = await pd.rawAccessToken();
// Send the unique ID that you use to identify this user in your system
const externalUserId = 'abc-123'; // Used in MCP URL to identify the user
// Initialize OpenAI client
const client = new OpenAI();
// Make the OpenAI request with the MCP server
const response = await client.responses.create({
model: 'gpt-4.1',
tools: [
{
type: 'mcp',
server_label: appLabel,
server_url: `https://remote.mcp.pipedream.net`,
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": PIPEDREAM_PROJECT_ID,
"x-pd-environment": PIPEDREAM_ENVIRONMENT,
"x-pd-external-user-id": externalUserId,
"x-pd-app-slug": appSlug,
},
require_approval: 'never'
}
],
input: 'Summarize my most recently created Notion doc for me and help draft an email to our customers'
});
console.log(response);
output_text from OpenAI:
"output_text": "To access and summarize your most recently created Notion doc, you'll first need to connect your Notion account to this tool. Please click the link below to securely connect your Notion workspace:\n\n[Connect Notion to this tool](https://pipedream.com/_static/connect.html?token=ctok_xxx&connectLink=true&app=notion)\n\nOnce connected, I'll be able to retrieve and summarize your latest document and help you draft an email for your customers! Let me know once you've completed the connection."
Then after I connect my account w/ that URL and run it again, I get the real tool call response that I would expect.
And the final output text:
output_text: "It looks like I wasn't able to access your Notion database directly due to a connection issue. However, if you paste the content or a link (if allowed) to your most recent Notion document here, I can review it, summarize the key points, and help you draft an email to your customers.\n\nPlease upload or paste the document content, or provide additional details about what the doc contains!",
}
Here’s the code, it seems to be the exact same:
import OpenAI from "openai";
import { createBackendClient } from "@pipedream/sdk/server";
// Initialize the Pipedream SDK client
const pd = createBackendClient({
environment: process.env.PIPEDREAM_ENVIRONMENT as
| "production"
| "development",
credentials: {
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
},
projectId: process.env.PIPEDREAM_PROJECT_ID!,
});
// Find the app to use for the MCP server
// For this example, we'll use Notion
const apps = await pd.getApps({ q: "notion" });
if (!apps.data || apps.data.length === 0) {
throw new Error("No app found");
}
const app = apps.data[0];
console.log("APPS: ", apps);
if (!app || !app.name_slug || !app.name) {
throw new Error("App data is incomplete");
}
const appSlug = app.name_slug; // e.g., "notion",
const appLabel = app.name; // e.g., "Notion"
// Get access token for MCP server auth
const accessToken = await pd.rawAccessToken();
// Send the unique ID that you use to identify this user in your system
const externalUserId = "abc-123"; // Used in MCP URL to identify the user
// Initialize OpenAI client
const client = new OpenAI();
// Print out API keys for debugging
console.log("=== API Keys ===");
console.log("PIPEDREAM_CLIENT_ID:", process.env.PIPEDREAM_CLIENT_ID);
console.log("PIPEDREAM_CLIENT_SECRET:", process.env.PIPEDREAM_CLIENT_SECRET);
console.log("PIPEDREAM_PROJECT_ID:", process.env.PIPEDREAM_PROJECT_ID);
console.log("OPENAI_API_KEY:", process.env.OPENAI_API_KEY);
console.log("ARCADE_API_KEY:", process.env.ARCADE_API_KEY);
console.log("ACCESS TOKEN: ", accessToken);
console.log("==================");
// Make the OpenAI request with the MCP server
const response = await client.responses.create({
model: "gpt-4.1",
tools: [
{
type: "mcp",
server_label: appLabel,
server_url: `https://remote.mcp.pipedream.net`,
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
"x-pd-environment": process.env.PIPEDREAM_ENVIRONMENT!,
"x-pd-external-user-id": externalUserId,
"x-pd-app-slug": appSlug,
},
require_approval: "never",
},
],
input: "Summarize my most recently created Notion doc for me and help draft an email to our customers",
});
console.log(response);
Also made sure all the API keys were provided
Does something on the account need to be enabled / have to join the beta for Connect somehow? Maybe something wrong with the “project id” / environment
No, I’m gonna DM you so I can ask for some IDs to help debug




