get_component_docs
Retrieve complete documentation for Modus Web Components including attributes, events, and usage examples to implement components correctly in your projects.
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 handler function that executes the tool logic: normalizes the component name, finds the corresponding documentation in the loaded docs array, and returns it as MCP content or an error message listing 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, }, ], }; }
- src/index.ts:185-195 (schema)Input schema defining the required 'component' parameter as a string.inputSchema: { type: "object", properties: { component: { type: "string", description: 'The component name (e.g., "button", "card", "modal")', }, }, required: ["component"], },
- src/index.ts:181-196 (registration)Tool registration in the ListToolsRequestSchema response, including name, description, and input schema.{ 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 CallToolRequestSchema handler that invokes the getComponentDocs method with the provided arguments.case "get_component_docs": return await this.getComponentDocs( (args?.component as string) || "" );