Skip to content
Open
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
3 changes: 2 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import "dotenv/config";
import { getGuide} from "./tools.js";
import { getGuideParams } from "./params.js";
import { createGetGuideParams } from "./params.js";
import { fetchAndUpdateSidebar } from "./sidebar.js";

// Initialize the server
Expand All @@ -13,6 +13,7 @@ const server = new McpServer({

// Fetch sidebar before starting the server
await fetchAndUpdateSidebar();
const getGuideParams = createGetGuideParams();

server.tool(
"BuildOnBase",
Expand Down
11 changes: 7 additions & 4 deletions params.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { z } from "zod";
import { findGuideParamsPrompt } from "./utils";
import { getFindGuideParamsPrompt } from "./utils";

export function createGetGuideParams() {
return z.object({
guideLink: z.string().describe(getFindGuideParamsPrompt()),
});
}

export const getGuideParams = z.object({
guideLink: z.string().describe(findGuideParamsPrompt),
});
export const getGuideParams = createGetGuideParams();

4 changes: 3 additions & 1 deletion utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export function getFormattedSidebar() {
return sidebar;
}

export const findGuideParamsPrompt = `
export function getFindGuideParamsPrompt() {
return `
This is the path to the technical documentation to create actions from.
To get the steps list, you need to pass the guideLink to the BuildOnBase getGuide tool.
From the user prompt, find the most relevant guide from the sidebar of the docs website.
Expand All @@ -21,6 +22,7 @@ export const findGuideParamsPrompt = `

You will find that in the sidebar list, the guide is under the "Smart Wallet" section.
`;
}

export const testingPrompt = (code: string) => {
return `
Expand Down