Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

get_product

Retrieve detailed product information from CS-Cart stores using product ID for inventory management and customer support.

Instructions

Get detailed information about a specific product

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
product_idYesProduct ID

Implementation Reference

  • The primary handler function for the 'get_product' tool. It makes a GET request to the CS-Cart API endpoint `/products/{product_id}` using the makeRequest helper and returns the JSON-formatted result.
    async getProduct(args) {
      const result = await this.makeRequest('GET', `/products/${args.product_id}`);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • src/index.js:75-88 (registration)
    Registration of the 'get_product' tool in the ListToolsRequestSchema response, defining its 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'],
      },
    },
  • The 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'],
    },
  • Helper method used by the get_product handler (and others) to perform authenticated API requests to the CS-Cart server using axios.
    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;
    }
  • Dispatch case in the CallToolRequestSchema handler that routes calls to the 'get_product' tool to its implementation method.
    case 'get_product':
      return await this.getProduct(args);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a read operation ('Get'), implying it's likely safe and non-destructive, but doesn't confirm this or add details like error handling (e.g., what happens if the product_id is invalid), authentication needs, rate limits, or response format. This leaves significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly. There's no wasted verbiage or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a read operation with one parameter) and the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'detailed information' includes, potential return values, or error conditions. For a tool that likely returns structured data, more context is needed to guide the agent effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the single parameter 'product_id' documented in the schema. The description doesn't add any meaning beyond this, such as explaining what a product ID is or how to obtain it. Since the schema handles the parameter documentation adequately, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('detailed information about a specific product'), making the purpose unambiguous. However, it doesn't explicitly distinguish this from sibling tools like 'get_products' (plural) or 'update_product', which would require more specific differentiation for a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a product ID), contrast with 'get_products' for listing multiple products, or specify use cases like retrieving product details for updates or orders. This leaves the agent without contextual usage cues.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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