Skip to main content
Glama
Lingzhhiiii

Shoplazza MCP Tool

by Lingzhhiiii

get-lessjs

Retrieve documentation for Shoplazza LessJS components, including properties, methods, events, and example code, to streamline development and integration processes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentNameYes

Implementation Reference

  • The main handler function for the 'get-lessjs' tool. It fetches the component HTML from the LessJS API and processes it with extractComponentDocumentation to return JSON-formatted documentation.
    async ({componentName}) => { const response = await fetch( `https://lessjs.shoplazza.com/latest/components/${componentName}/`, { method: "GET", } ); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const html = await response.text(); const docData = extractComponentDocumentation(html); return { content: [ { type: "text", text: JSON.stringify(docData, null, 2) } ] }; }
  • Input schema for the 'get-lessjs' tool, requiring a 'componentName' string parameter.
    { componentName: z.string() },
  • src/index.ts:14-42 (registration)
    Registration of the 'get-lessjs' tool on the MCP server using server.tool().
    server.tool("get-lessjs", { componentName: z.string() }, async ({componentName}) => { const response = await fetch( `https://lessjs.shoplazza.com/latest/components/${componentName}/`, { method: "GET", } ); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const html = await response.text(); const docData = extractComponentDocumentation(html); return { content: [ { type: "text", text: JSON.stringify(docData, null, 2) } ] }; } );
  • Helper function that parses LessJS component HTML into structured documentation data, used by the tool handler.
    export function extractComponentDocumentation(html: string): ComponentDoc { return { name: 'spz-accordion', ...extractTitleAndDescription(html), usage: extractUsage(html), properties: extractProperties(html), methods: extractMethods(html), events: extractEvents(html), examples: extractExamples(html) }; }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Lingzhhiiii/shoplazza-mcps'

If you have feedback or need assistance with the MCP directory API, please join our Discord server