build_stacks_dapp
Create complete Stacks blockchain applications with comprehensive resources for Clarity smart contracts, frontend integration, token standards, and security patterns.
Instructions
Build a complete full-stack Stacks dApp - returns comprehensive resources covering Clarity contracts, frontend integration, token standards, and security patterns. Use this tool when you need guidance on building complete Stacks applications.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:152-169 (registration)Registration of the 'build_stacks_dapp' tool, including name, description, empty input schema, and the execute handler function that aggregates markdown documentation from multiple Stacks development resource directories.server.addTool({ name: "build_stacks_dapp", description: "Build a complete full-stack Stacks dApp - returns comprehensive resources covering Clarity contracts, frontend integration, token standards, and security patterns. Use this tool when you need guidance on building complete Stacks applications.", parameters: z.object({}), execute: async () => { const content = await readAllMarkdownFromDirectories([ "clarity", "frontend", "tokens", "management", ]); return { text: content || "No content found in Stacks development directories.", type: "text", }; }, });
- src/server.ts:156-168 (handler)The core handler function (execute) for 'build_stacks_dapp' tool. It calls readAllMarkdownFromDirectories with specific directories and returns the combined content as text.execute: async () => { const content = await readAllMarkdownFromDirectories([ "clarity", "frontend", "tokens", "management", ]); return { text: content || "No content found in Stacks development directories.", type: "text", }; },
- src/utils/index.ts:41-56 (helper)Supporting helper function that combines markdown content from multiple directories, used by the tool handler to load Stacks development resources.export async function readAllMarkdownFromDirectories( dirNames: string[] ): Promise<string> { let combinedContent = ""; for (const dirName of dirNames) { const dirPath = pathJoin(resourcesDir, dirName); const dirContent = await readAllMarkdownFromDirectory(dirPath); if (dirContent.trim()) { combinedContent += `# ${dirName.toUpperCase()} RESOURCES\n\n`; combinedContent += dirContent; } } return combinedContent; }
- src/utils/index.ts:61-92 (helper)Lower-level helper that reads all .md files from a single directory and concatenates them, called by readAllMarkdownFromDirectories.export async function readAllMarkdownFromDirectory( dirPath: string ): Promise<string> { let content = ""; try { if (!fs.existsSync(dirPath)) { return `Directory not found: ${dirPath}`; } const files = fs.readdirSync(dirPath); const markdownFiles = files.filter( (file: string) => extname(file).toLowerCase() === ".md" ); for (const file of markdownFiles) { const filePath = pathJoin(dirPath, file); try { const fileContent = await readFile(filePath, "utf-8"); content += fileContent + "\n\n---\n\n"; } catch (error) { console.error(`Error reading file ${filePath}:`, error); content += `Error reading file: ${file}\n\n---\n\n`; } } return content; } catch (error) { console.error(`Error reading directory ${dirPath}:`, error); return `Error reading directory: ${dirPath}`; } }