Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/en/resources/integrations/components/toolkit-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ export const normalizeString = (str: string) =>

/**
* Find toolkit from pathname
* e.g., /en/mcp-servers/productivity/gmail -> Gmail toolkit
* e.g., /en/resources/integrations/productivity/gmail/reference -> Gmail toolkit
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong path segment extracted for toolkit identification

The comment was updated to reflect the new URL structure ending in /reference (e.g., /en/resources/integrations/productivity/gmail/reference), but the code still extracts the last path segment using pathSegments.at(-1). This now returns "reference" instead of the actual toolkit name like "gmail". The function will always return null because "reference" won't match any toolkit ID in TOOLKIT_CATALOGUE, breaking toolkit identification throughout the app.

Fix in Cursor Fix in Web

*/
export const findToolkitFromPath = (pathname: string | null) => {
if (!pathname) {
return null;
}

const pathSegments = pathname.split("/").filter(Boolean);
const toolkitSlug = pathSegments.at(-1);
// URL structure: /en/resources/integrations/{category}/{toolkit}/reference
// The toolkit name is the second-to-last segment
const toolkitSlug = pathSegments.at(-2);

if (!toolkitSlug) {
return null;
Expand Down
17 changes: 16 additions & 1 deletion app/en/resources/integrations/components/toolkits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ import { ToolCard } from "./tool-card";
import { TYPE_CONFIG, TYPE_DESCRIPTIONS } from "./type-config";
import { useFilterStore, useToolkitFilters } from "./use-toolkit-filters";

// Map old MCP server paths to new integration paths
function mapToNewIA(oldLink: string): string {
// Pattern: /en/mcp-servers/{category}/{tool} -> /en/resources/integrations/{category}/{tool}/reference
const mcpServerPattern = /^\/en\/mcp-servers\/([^/]+)\/([^/]+)$/;
const match = oldLink.match(mcpServerPattern);

if (match) {
const [, category, tool] = match;
return `/en/resources/integrations/${category}/${tool}/reference`;
}

// Return original link if it doesn't match the pattern
return oldLink;
}

export default function Toolkits() {
const clearAllFilters = useFilterStore((state) => state.clearAllFilters);

Expand Down Expand Up @@ -123,7 +138,7 @@ export default function Toolkits() {
isComingSoon={toolkit.isComingSoon}
isPro={toolkit.isPro}
key={toolkit.id}
link={toolkit.relativeDocsLink}
link={mapToNewIA(toolkit.relativeDocsLink)}
name={toolkit.label}
type={toolkit.type}
/>
Expand Down
2 changes: 1 addition & 1 deletion lib/remark-glossary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function remarkGlossary(options: RemarkGlossaryOptions) {
}

// don't process the many MCP tool pages
if (file.history?.[0]?.includes("/mcp-servers/")) {
if (file.history?.[0]?.includes("/resources/integrations/")) {
return;
}

Expand Down
48 changes: 48 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,46 +99,94 @@ const nextConfig: NextConfig = withLlmsTxt({
destination: "/guides/create-tools/tool-basics/call-tools-mcp",
permanent: true, // 308 redirect for SEO
},
{
source: "/en/home/build-tools/call-tools-from-mcp-clients",
destination: "/en/guides/create-tools/tool-basics/call-tools-mcp",
permanent: true, // 308 redirect for SEO
},
{
source: "/home/build-tools/create-a-mcp-server",
destination: "/guides/create-tools/tool-basics/build-mcp-server",
permanent: true, // 308 redirect for SEO
},
{
source: "/en/home/build-tools/create-a-mcp-server",
destination: "/en/guides/create-tools/tool-basics/build-mcp-server",
permanent: true, // 308 redirect for SEO
},
{
source: "/home/build-tools/create-a-tool-with-auth",
destination: "/guides/create-tools/tool-basics/create-tool-auth",
permanent: true, // 308 redirect for SEO
},
{
source: "/en/home/build-tools/create-a-tool-with-auth",
destination: "/en/guides/create-tools/tool-basics/create-tool-auth",
permanent: true, // 308 redirect for SEO
},
{
source: "/home/build-tools/create-a-tool-with-secrets",
destination: "/guides/create-tools/tool-basics/create-tool-secrets",
permanent: true, // 308 redirect for SEO
},
{
source: "/en/home/build-tools/create-a-tool-with-secrets",
destination:
"/en/guides/create-tools/tool-basics/create-tool-secrets",
permanent: true, // 308 redirect for SEO
},
{
source: "/home/build-tools/migrate-from-toolkits",
destination: "/guides/create-tools/migrate-toolkits",
permanent: true, // 308 redirect for SEO
},
{
source: "/en/home/build-tools/migrate-from-toolkits",
destination: "/en/guides/create-tools/migrate-toolkits",
permanent: true, // 308 redirect for SEO
},
{
source: "/home/build-tools/organize-mcp-server-tools",
destination: "/guides/create-tools/tool-basics/organize-mcp-tools",
permanent: true, // 308 redirect for SEO
},
{
source: "/en/home/build-tools/organize-mcp-server-tools",
destination: "/en/guides/create-tools/tool-basics/organize-mcp-tools",
permanent: true, // 308 redirect for SEO
},
{
source: "/home/build-tools/providing-useful-tool-errors",
destination: "/guides/create-tools/error-handling/useful-tool-errors",
permanent: true, // 308 redirect for SEO
},
{
source: "/en/home/build-tools/providing-useful-tool-errors",
destination:
"/en/guides/create-tools/error-handling/useful-tool-errors",
permanent: true, // 308 redirect for SEO
},
{
source: "/home/build-tools/retry-tools-with-improved-prompt",
destination: "/guides/create-tools/error-handling/retry-tools",
permanent: true, // 308 redirect for SEO
},
{
source: "/en/home/build-tools/retry-tools-with-improved-prompt",
destination: "/en/guides/create-tools/error-handling/retry-tools",
permanent: true, // 308 redirect for SEO
},
{
source: "/home/build-tools/tool-context",
destination: "/guides/create-tools/tool-basics/runtime-data-access",
permanent: true, // 308 redirect for SEO
},
{
source: "/en/home/build-tools/tool-context",
destination:
"/en/guides/create-tools/tool-basics/runtime-data-access",
permanent: true, // 308 redirect for SEO
},
{
source: "/home/changelog",
destination: "/references/changelog",
Expand Down