Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

get_product

Retrieve detailed product information by specifying the product ID to efficiently manage and analyze CS-Cart store inventory and listings.

Instructions

Get detailed information about a specific product

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
product_idYesProduct ID

Implementation Reference

  • The getProduct method that executes the core tool logic: fetches the specific product from CS-Cart API and returns it as JSON text.
    async getProduct(args) { const result = await this.makeRequest('GET', `/products/${args.product_id}`); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Input schema defining the required product_id parameter for the get_product tool.
    inputSchema: { type: 'object', properties: { product_id: { type: 'number', description: 'Product ID', }, }, required: ['product_id'], },
  • src/index.js:75-88 (registration)
    Registration of the get_product tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    { name: 'get_product', description: 'Get detailed information about a specific product', inputSchema: { type: 'object', properties: { product_id: { type: 'number', description: 'Product ID', }, }, required: ['product_id'], }, },
  • src/index.js:392-393 (registration)
    Dispatch registration in the CallToolRequestSchema switch statement that calls the getProduct handler.
    case 'get_product': return await this.getProduct(args);
  • Helper method used by the getProduct handler to perform authenticated API requests to the CS-Cart backend.
    async makeRequest(method, endpoint, data = null) { const config = { method, url: `${process.env.CSCART_API_URL}${endpoint}`, headers: { 'Content-Type': 'application/json', 'Authorization': `Basic ${Buffer.from(`${process.env.CSCART_API_EMAIL}:${process.env.CSCART_API_KEY}`).toString('base64')}`, }, }; if (data) { config.data = data; } const response = await axios(config); return response.data; }

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/hungryweb/cscart-mcp'

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