get_setup_guide
Get setup instructions for HTML or React projects using Modus Web Components. Choose from HTML, React, or testing configurations to start building with the design system.
Instructions
Get setup instructions for HTML or React projects using Modus Web Components.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | The setup type ("html", "react", "testing") |
Implementation Reference
- src/index.ts:677-705 (handler)The main handler function that executes the tool logic: searches loaded setup documents for a matching guide by type and returns its content as text, or lists available types if not found.private async getSetupGuide(type: string): Promise<any> { const normalizedType = type.toLowerCase(); const guide = this.setup.find( (s) => s.setupType.toLowerCase() === normalizedType || s.filename.toLowerCase().includes(normalizedType) ); if (!guide) { const availableTypes = this.setup.map((s) => s.setupType).join(", "); return { content: [ { type: "text", text: `Setup guide type "${type}" not found.\n\nAvailable types: ${availableTypes}`, }, ], }; } return { content: [ { type: "text", text: guide.content, }, ], }; }
- src/index.ts:329-330 (registration)Registers the tool dispatch in the CallToolRequestSchema handler switch statement, calling the getSetupGuide method with the type argument.case "get_setup_guide": return await this.getSetupGuide((args?.type as string) || "");
- src/index.ts:261-275 (registration)Registers the tool in the ListToolsRequestSchema response, including name, description, and input schema.{ name: "get_setup_guide", description: "Get setup instructions for HTML or React projects using Modus Web Components.", inputSchema: { type: "object", properties: { type: { type: "string", description: 'The setup type ("html", "react", "testing")', }, }, required: ["type"], }, },
- src/index.ts:265-274 (schema)Defines the input schema for the tool, specifying an object with a required 'type' string property.inputSchema: { type: "object", properties: { type: { type: "string", description: 'The setup type ("html", "react", "testing")', }, }, required: ["type"], },
- src/index.ts:135-160 (helper)Helper method that loads setup guide markdown files from the setup directory into the this.setup array, which is used by the handler.private loadSetup(): void { if (!existsSync(this.setupPath)) { console.error(`Setup directory not found at: ${this.setupPath}`); console.error("Please run: node download-docs.js"); return; } const files = readdirSync(this.setupPath).filter((f) => f.endsWith(".md")); for (const file of files) { const content = readFileSync(join(this.setupPath, file), "utf-8"); let setupType = file.replace(".md", "").replace("setup_", ""); // Map filenames to more user-friendly types if (setupType === "universal_rules") setupType = "universal"; if (setupType === "theme_usage") setupType = "theme"; this.setup.push({ filename: file, setupType, content, }); } console.error(`Loaded ${this.setup.length} setup guide files`); }