Skip to main content
Glama

search_ram

Find compatible RAM for PC builds or upgrades by specifying DDR generation, capacity, speed, and budget to compare available options.

Instructions

Specialized memory (RAM) search tool. Find desktop or laptop memory by DDR generation, total capacity, speed, and price. Essential for system upgrades or new builds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoRAM generation/type. Options: 'DDR4' (older systems, cheaper), 'DDR5' (newest, faster). Must match motherboard compatibility
capacityNoTotal memory capacity in GB. Common values: 8, 16, 32, 64. Example: 32 for 32GB total (can be 2x16GB or 4x8GB kit)
frequencyNoMemory speed in MHz. DDR4 common: 3200, 3600. DDR5 common: 4800, 5600, 6000. Higher = better performance
sort_byNoPrice sorting order. 'price_asc' = budget options first, 'price_desc' = premium/performance kits first
limitNoMaximum results to return. Valid range: 1-50, default: 10. More results = more brand choices

Implementation Reference

  • The primary handler function for the 'search_ram' tool. It filters RAM products from the loaded product data based on parameters like type (DDR4/DDR5), capacity (GB), frequency (MHz), applies sorting and limiting, and returns JSON-formatted results.
    private searchRAM(args: any) {
      const { type, capacity, frequency, sort_by, limit = 10 } = args;
      const results: any[] = [];
    
      // Find RAM category
      const ramCategory = this.productData.find(cat => 
        cat.category_name.includes('記憶體') || cat.category_name.includes('RAM')
      );
    
      if (!ramCategory) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                error: "RAM category not found",
                results: []
              }, null, 2),
            },
          ],
        };
      }
    
      // Search through all RAM subcategories
      for (const subcat of ramCategory.subcategories) {
        for (const product of subcat.products) {
          let matches = true;
    
          // Filter by type if specified (DDR4, DDR5)
          if (type && matches) {
            const typeLower = type.toLowerCase();
            const subcatLower = subcat.name.toLowerCase();
            const specsText = product.specs.join(' ').toLowerCase();
            const rawTextLower = product.raw_text.toLowerCase();
            
            if (!subcatLower.includes(typeLower) && 
                !specsText.includes(typeLower) && 
                !rawTextLower.includes(typeLower)) {
              matches = false;
            }
          }
    
          // Filter by capacity if specified
          if (capacity && matches) {
            const capPattern = new RegExp(`${capacity}GB`, 'i');
            const specsText = product.specs.join(' ');
            const hasCapacity = capPattern.test(specsText) || 
                               capPattern.test(product.raw_text) ||
                               capPattern.test(product.model || '');
            
            if (!hasCapacity) {
              matches = false;
            }
          }
    
          // Filter by frequency if specified
          if (frequency && matches) {
            const freqPattern = new RegExp(`${frequency}(?:MHz)?`, 'i');
            const specsText = product.specs.join(' ');
            const hasFrequency = freqPattern.test(specsText) || 
                                freqPattern.test(product.raw_text);
            
            if (!hasFrequency) {
              matches = false;
            }
          }
    
          if (matches) {
            results.push({
              ...product,
              category_name: ramCategory.category_name,
              subcategory_name: subcat.name,
            });
          }
        }
      }
    
      // Sort results
      if (sort_by === 'price_asc') {
        results.sort((a, b) => a.price - b.price);
      } else if (sort_by === 'price_desc') {
        results.sort((a, b) => b.price - a.price);
      }
    
      // Apply limit
      const limitedResults = results.slice(0, limit);
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              total_found: results.length,
              showing: limitedResults.length,
              filters: {
                type: type || "any",
                capacity: capacity || "any",
                frequency: frequency || "any",
                sort_by: sort_by || "none"
              },
              results: limitedResults.map(p => ({
                brand: p.brand,
                model: p.model,
                specs: p.specs,
                price: p.price,
                original_price: p.original_price,
                discount_amount: p.discount_amount,
                subcategory: p.subcategory_name,
                markers: p.markers,
              })),
            }, null, 2),
          },
        ],
      };
    }
  • The tool schema definition including name, description, and inputSchema for parameters: type, capacity, frequency, sort_by, limit. Returned by ListToolsRequestHandler.
    {
      name: "search_ram",
      description: "Specialized memory (RAM) search tool. Find desktop or laptop memory by DDR generation, total capacity, speed, and price. Essential for system upgrades or new builds.",
      inputSchema: {
        type: "object",
        properties: {
          type: {
            type: "string",
            description: "RAM generation/type. Options: 'DDR4' (older systems, cheaper), 'DDR5' (newest, faster). Must match motherboard compatibility",
          },
          capacity: {
            type: "number",
            description: "Total memory capacity in GB. Common values: 8, 16, 32, 64. Example: 32 for 32GB total (can be 2x16GB or 4x8GB kit)",
          },
          frequency: {
            type: "number",
            description: "Memory speed in MHz. DDR4 common: 3200, 3600. DDR5 common: 4800, 5600, 6000. Higher = better performance",
          },
          sort_by: {
            type: "string",
            enum: ["price_asc", "price_desc"],
            description: "Price sorting order. 'price_asc' = budget options first, 'price_desc' = premium/performance kits first",
          },
          limit: {
            type: "number",
            description: "Maximum results to return. Valid range: 1-50, default: 10. More results = more brand choices",
          },
        },
      },
    },
  • src/index.ts:311-312 (registration)
    Registration in the CallToolRequestHandler switch statement: dispatches 'search_ram' calls to the searchRAM method.
    case "search_ram":
      return this.searchRAM(args);
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. It mentions the tool is for searching/finding memory, which implies a read-only operation, but doesn't disclose behavioral traits like whether it requires authentication, rate limits, error handling, or what the output format looks like (e.g., list of products with details). This leaves significant gaps for an agent to understand how to interact with it effectively.

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

Conciseness4/5

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

The description is appropriately sized with two sentences: the first states the purpose and parameters, and the second provides usage context. It's front-loaded with key information and avoids unnecessary details, though it could be slightly more structured (e.g., bullet points for parameters).

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 (5 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool returns (e.g., product listings, availability, links), how results are formatted, or any prerequisites (e.g., authentication). For a search tool with multiple parameters and no output schema, this leaves the agent without crucial context for successful invocation.

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 description lists the search criteria (DDR generation, capacity, speed, price), which aligns with the input schema parameters. However, with 100% schema description coverage, the schema already provides detailed parameter information (e.g., options, examples, ranges). The description adds minimal value beyond restating the parameters, so it meets the baseline of 3.

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: 'Find desktop or laptop memory by DDR generation, total capacity, speed, and price.' It specifies the resource (memory/RAM) and the search criteria, though it doesn't explicitly differentiate from sibling tools like 'search_products' or 'search_cpu' beyond mentioning it's 'specialized' for RAM.

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

Usage Guidelines3/5

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

The description provides implied usage context: 'Essential for system upgrades or new builds.' This suggests when to use the tool, but it doesn't explicitly state when not to use it or name alternatives among sibling tools (e.g., 'search_products' might be a broader alternative).

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/shyuan/coolpc-mcp-server'

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