get_component_docs
Access complete documentation for any Modus Web Component, including attributes, events, and usage examples. Get help with component usage and design guidelines directly in your IDE.
Instructions
Get the complete documentation for a specific Modus Web Component including attributes, events, and usage examples.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| component | Yes | The component name (e.g., "button", "card", "modal") |
Implementation Reference
- src/index.ts:182-196 (schema)Tool registration/schema definition for 'get_component_docs' - declares the tool name, description, and input schema requiring a 'component' string parameter.
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)Tool dispatch/routing: the CallToolRequestSchema handler maps 'get_component_docs' to the getComponentDocs method.
case "get_component_docs": return await this.getComponentDocs( (args?.component as string) || "" ); - src/index.ts:416-444 (handler)Handler implementation: getComponentDocs() looks up a component doc by name, normalizes it (removes 'modus-wc-' prefix, lowercases), searches the loaded docs array, and returns the markdown content or an error with available components.
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, }, ], }; }