get_documentation
Retrieve documentation links for Starwind UI components, including overviews, installation guides, theming instructions, and component-specific details.
Instructions
Returns documentation links for Starwind UI
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Type of documentation to retrieve (defaults to overview) | |
| component | No | Specific component to get documentation for (only used when type is components) |
Implementation Reference
- src/tools/documentation_tool.ts:94-155 (handler)The async handler function that implements the core logic of the 'get_documentation' tool. It processes input arguments to return appropriate documentation URLs, component lists, or specific component info based on the requested type.handler: async (args: DocumentationArgs = {}) => { const docType = args.type || "overview"; // Base documentation response const response: Record<string, any> = { timestamp: new Date().toISOString(), }; // If requesting component-specific documentation if (docType === "components" && args.component) { const componentName = args.component.toLowerCase(); // Check if the component name is a valid key in COMPONENTS if (componentName in COMPONENTS && isValidComponentName(componentName)) { response.documentationType = "component"; response.component = componentName; response.url = COMPONENTS[componentName as ComponentName]; response.importExample = `import { ${componentName.charAt(0).toUpperCase() + componentName.slice(1)} } from "@/components/starwind/${componentName}";`; } else { response.documentationType = "components"; response.url = DOCS_URLS.components; response.availableComponents = Object.keys(COMPONENTS); response.message = `Component '${args.component}' not found. Please choose from the available components list.`; } } // If requesting general documentation else { response.documentationType = docType; // For overview, provide all main links if (docType === "overview") { response.mainLinks = { home: DOCS_URLS.home, gettingStarted: DOCS_URLS["getting-started"], cli: DOCS_URLS.cli, installation: DOCS_URLS.installation, theming: DOCS_URLS.theming, components: DOCS_URLS.components, fullReference: DOCS_URLS.full, }; response.description = "Starwind UI is an open-source component library for Astro projects, styled with Tailwind CSS v4. It provides accessible, customizable components that can be added directly to your projects."; response.availableComponents = Object.keys(COMPONENTS); } // For components listing else if (docType === "components") { response.url = DOCS_URLS.components; response.components = Object.entries(COMPONENTS).map(([name, url]) => ({ name, url, })); response.importPattern = 'import { ComponentName } from "@/components/starwind/component-name";'; } // For other doc types else { response.url = DOCS_URLS[docType] || DOCS_URLS.home; } } return response; },
- The JSON input schema defining the parameters for the 'get_documentation' tool, including optional 'type' and 'component' fields.inputSchema: { type: "object", properties: { type: { type: "string", description: "Type of documentation to retrieve (defaults to overview)", enum: [ "overview", "getting-started", "cli", "installation", "theming", "components", "full", ], }, component: { type: "string", description: "Specific component to get documentation for (only used when type is components)", }, }, required: [], },
- src/tools/documentation_tool.ts:9-21 (schema)TypeScript interface defining the input arguments for the documentation tool handler.export interface DocumentationArgs { /** Type of documentation to retrieve (defaults to 'overview') */ type?: | "overview" | "getting-started" | "cli" | "installation" | "theming" | "components" | "full"; /** Specific component to get documentation for (only used when type is 'components') */ component?: string; }
- src/tools/index.ts:46-47 (registration)Registration of the 'get_documentation' tool into the central tools Map, using its exported definition from documentation_tool.ts.// Register documentation tool tools.set(documentationTool.name, documentationTool);
- src/config/settings.ts:31-39 (registration)Configuration listing 'get_documentation' as an enabled tool.enabled: [ "get_package_manager", "fetch_llm_data", "get_documentation", "init_project", "install_component", "update_component", ], },