get_component_docs
Retrieve complete documentation for Modus Web Components including attributes, events, and usage examples to understand component implementation and design guidelines.
Instructions
Get the complete documentation for a specific Modus Web Component including attributes, events, and usage examples.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| component | Yes | The component name (e.g., "button", "card", "modal") |
Implementation Reference
- src/index.ts:416-444 (handler)The main handler function for the get_component_docs tool. It normalizes the component name, searches the loaded docs array for a matching component, and returns the full documentation content or a list of available components if not found.private async getComponentDocs(component: string): Promise<any> { const normalizedComponent = component .toLowerCase() .replace("modus-wc-", ""); const doc = this.docs.find( (d) => d.component.toLowerCase() === normalizedComponent ); if (!doc) { const availableComponents = this.docs.map((d) => d.component).join(", "); return { content: [ { type: "text", text: `Component "${component}" not found.\n\nAvailable components: ${availableComponents}`, }, ], }; } return { content: [ { type: "text", text: doc.content, }, ], }; }
- src/index.ts:181-196 (schema)Tool schema definition including name, description, and input schema for the get_component_docs tool, registered in the ListToolsRequestHandler.{ name: "get_component_docs", description: "Get the complete documentation for a specific Modus Web Component including attributes, events, and usage examples.", inputSchema: { type: "object", properties: { component: { type: "string", description: 'The component name (e.g., "button", "card", "modal")', }, }, required: ["component"], }, },
- src/index.ts:307-310 (registration)Dispatch case in the CallToolRequestHandler switch statement that routes calls to the getComponentDocs handler.case "get_component_docs": return await this.getComponentDocs( (args?.component as string) || "" );