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;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool generates code but doesn't explain how (e.g., whether it produces executable snippets, includes error handling, or requires authentication). It also omits details like rate limits, side effects, or output format, which are critical for a code generation tool with no output schema. The description is insufficient for behavioral understanding beyond the basic action.

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 front-loads the core purpose without unnecessary details. It uses clear language ('Generate implementation code') and specifies key aspects ('any Searchspring API', 'platform-specific examples'). There's no waste or redundancy, making it highly concise and well-structured for quick understanding.

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 complexity of a code generation tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It lacks behavioral details (e.g., how code is formatted, if it includes dependencies), doesn't explain interactions between parameters (e.g., how 'eventType' relates to 'api'), and provides no output information. This leaves significant gaps for an agent to use the tool 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?

Schema description coverage is 100%, with all parameters well-documented in the schema (e.g., 'api' and 'platform' enums, 'eventType' for specific APIs, 'useCase' as optional). The description adds no additional parameter semantics beyond what the schema provides, such as examples or constraints. Baseline 3 is appropriate since the schema does the heavy lifting, but the description doesn't compensate with extra context.

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 tool's purpose: 'Generate implementation code for any Searchspring API with platform-specific examples.' It specifies the verb ('Generate'), resource ('implementation code'), and scope ('Searchspring API'). However, it doesn't explicitly differentiate from sibling tools like 'searchspring_code_validator' or 'searchspring_api_guide', which likely serve different purposes (validation vs. guidance vs. generation).

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 sibling tools or other contexts where this tool might be preferred or avoided. Usage is implied by the purpose but lacks explicit instructions or exclusions, leaving the agent to infer based on the name and description alone.

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

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