Skip to main content
Glama
yangjeep

Searchspring Integration Assistant

by yangjeep

searchspring_code_generator

Generate platform-specific implementation code for Searchspring APIs including search, autocomplete, recommendations, and tracking to integrate e-commerce functionality.

Instructions

Generate implementation code for any Searchspring API with platform-specific examples

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiYesThe Searchspring API to generate code for
platformYesPlatform or language for code generation
eventTypeNoType of tracking event (for tracking/beacon APIs only)
useCaseNoSpecific use case or scenario for the code (optional)

Implementation Reference

  • Main handler function for searchspring_code_generator tool. Dispatches to specific code generation methods based on API and event type.
    async generateCode(params: CodeGeneratorParams) {
      const { api, platform, eventType, useCase } = params;
    
      // For backward compatibility, handle "tracking" as legacy alias
      const targetApi = api === "tracking" ? "beacon" : api;
    
      if (targetApi === "beacon" && eventType) {
        return this.generateTrackingCode(platform, eventType);
      }
    
      return this.generateApiCode(targetApi, platform, useCase);
    }
  • Handler dispatch in the main tool switch statement, calling the implementation.
    case "searchspring_code_generator":
      return await searchspringClient.generateCode(args as any);
  • Input schema definition for the searchspring_code_generator tool.
    {
      name: "searchspring_code_generator",
      description: "Generate implementation code for any Searchspring API with platform-specific examples",
      inputSchema: {
        type: "object",
        properties: {
          api: {
            type: "string",
            enum: ["search", "autocomplete", "suggest", "trending", "recommendations", "finder", "beacon", "bulk-index", "tracking"],
            description: "The Searchspring API to generate code for",
          },
          platform: {
            type: "string",
            enum: ["shopify", "bigcommerce", "magento2", "javascript", "php", "python", "custom"],
            description: "Platform or language for code generation",
          },
          eventType: {
            type: "string",
            enum: ["product", "cart", "sale", "search-click", "impression"],
            description: "Type of tracking event (for tracking/beacon APIs only)",
          },
          useCase: {
            type: "string",
            description: "Specific use case or scenario for the code (optional)",
          },
        },
        required: ["api", "platform"],
      },
    },
  • src/index.ts:130-132 (registration)
    Registration of all tools list handler, which includes this tool.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • TypeScript interface defining the parameters for code generation, matching the schema.
    export interface CodeGeneratorParams {
      api: "search" | "autocomplete" | "suggest" | "trending" | "recommendations" | "finder" | "beacon" | "bulk-index" | "tracking";
      platform: "shopify" | "bigcommerce" | "magento1" | "magento2" | "miva" | "commercev3" | "3dcart" | "volusion" | "javascript" | "php" | "python" | "custom";
      eventType?: "product" | "cart" | "sale" | "search-click" | "impression";
      useCase?: string;
    }

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/yangjeep/playground-searchspring-api-assist-mcp'

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