Skip to main content
Glama
loaditoutadmin

loaditout-mcp-server

Official

smart_search

Search for AI agent skills with personalized results that exclude already-installed skills and apply your preferences. Returns a JSON array of matching skills with metadata.

Instructions

Personalized skill search that automatically excludes already-installed skills and applies your preferences. Returns a JSON object with results array (each skill has slug, name, description, type, quality_score, stars, security_score, install_command), total count, and personalization metadata showing how many installed skills were excluded. This is the preferred search tool for most use cases. Use search_skills only when you need unfiltered results or specific type/agent filters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language search query describing what you need. Examples: 'postgres database', 'browser automation', 'github issues', 'stripe payments'. Keep queries to 1-4 words for best results.
limitNoMaximum number of results to return. Default: 10. Maximum: 25. Use 3-5 for quick lookups, 15-25 for comprehensive browsing.

Implementation Reference

  • Tool registration for smart_search in the TOOLS array, with name, description, and inputSchema (query required, limit optional).
    {
      name: "smart_search",
      description:
        "Search for skills with your history and preferences automatically applied. Returns personalized results excluding skills you already have. Use this by default instead of search_skills.",
      inputSchema: {
        type: "object" as const,
        properties: {
          query: {
            type: "string",
            description:
              "Natural language search query. Examples: 'postgres database', 'browser automation', 'github issues'",
          },
          limit: {
            type: "number",
            description: "Max results to return (default 10, max 25)",
          },
        },
        required: ["query"],
      },
    },
  • Handler function handleSmartSearch that loads agent memory, extracts installed slugs and recent searches, calls the search API, records the query, filters out already-installed skills, and returns personalized results with metadata.
    async function handleSmartSearch(args: {
      query: string;
      limit?: number;
    }): Promise<string> {
      // Load all agent memory (installed skills, recent searches, preferences)
      const memories = await loadAgentMemory();
      const installedSlugs = extractInstalledSlugs(memories);
      const recentSearches = extractRecentSearches(memories);
    
      const params = new URLSearchParams({ q: args.query });
      if (args.limit) params.set("limit", String(args.limit));
    
      const result = await fetchJSON(`${API_BASE}/search?${params.toString()}`, {
        "X-Agent-Key": AGENT_KEY,
      });
    
      // Fire-and-forget: record this search query
      recordSearchQuery(args.query, recentSearches);
    
      // Filter out already-installed skills
      const parsed = result as { results?: Array<{ slug?: string }>; [k: string]: unknown };
      const excludedCount = { value: 0 };
      if (parsed.results && installedSlugs.length > 0) {
        const installedSet = new Set(installedSlugs);
        const originalLength = parsed.results.length;
        parsed.results = parsed.results.filter((r) => !r.slug || !installedSet.has(r.slug));
        excludedCount.value = originalLength - parsed.results.length;
      }
    
      // Add metadata about personalization
      const output: Record<string, unknown> = { ...parsed };
      output._personalization = {
        installed_skills_excluded: excludedCount.value,
        installed_skills_count: installedSlugs.length,
        recent_searches: recentSearches.slice(-5),
      };
    
      return JSON.stringify(output, null, 2);
    }
  • Helper function loadAgentMemory that fetches agent memory entries from the API.
    async function loadAgentMemory(typeFilter?: string): Promise<AgentMemoryEntry[]> {
      try {
        const params = new URLSearchParams({ agent_key: AGENT_KEY });
        if (typeFilter) params.set("type", typeFilter);
        const result = (await fetchJSON(`${API_BASE}/memory?${params.toString()}`)) as {
          memories?: AgentMemoryEntry[];
        };
        return result.memories ?? [];
      } catch {
        return [];
      }
    }
  • Helper function extractInstalledSlugs that extracts installed skill slugs from agent memory.
    function extractInstalledSlugs(memories: AgentMemoryEntry[]): string[] {
      for (const m of memories) {
        if (m.key === "installed_skills" && Array.isArray(m.value)) {
          return m.value as string[];
        }
      }
      return [];
    }
  • Helper functions extractRecentSearches and recordSearchQuery that manage the recent search history in agent memory.
    function extractRecentSearches(memories: AgentMemoryEntry[]): string[] {
      for (const m of memories) {
        if (m.key === "recent_searches" && Array.isArray(m.value)) {
          return m.value as string[];
        }
      }
      return [];
    }
    
    /**
     * Fire-and-forget save to agent memory. Never throws.
     */
    function saveMemoryAsync(key: string, value: unknown, type: string): void {
      postJSON(`${API_BASE}/memory`, {
        agent_key: AGENT_KEY,
        key,
        value,
        type,
      }).catch(() => {});
    }
    
    /**
     * Append a search query to the recent_searches memory (keep last 20).
     */
    function recordSearchQuery(query: string, existingSearches: string[]): void {
      const updated = [...existingSearches.filter((q) => q !== query), query].slice(-20);
      saveMemoryAsync("recent_searches", updated, "search");
    }
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses the automatic exclusion of installed skills and application of preferences, and details the return structure (results array fields, total count, personalization metadata). This goes beyond the input schema. However, it doesn't explicitly state it's read-only or mention potential side effects, though for a search tool that is typically safe.

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 concise and well-structured. It front-loads the purpose and behavior, then provides output details, and ends with usage guidance. Every sentence earns its place without redundancy.

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

Completeness5/5

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

Given the tool has 2 parameters, no output schema, and no annotations, the description fully compensates by describing the output structure in detail. It covers purpose, behavior, usage guidance, and output format, making it complete for an agent to use correctly. No obvious gaps.

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%, so the schema already documents both parameters well. The description does not add significant parameter-level detail beyond what the schema provides, but it does provide context about the search behavior. According to guidelines, baseline is 3 when schema coverage is high.

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

Purpose5/5

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

The description clearly states it is a personalized skill search that excludes installed skills and applies preferences. It explicitly distinguishes itself from sibling search_skills, specifying when each should be used.

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

Usage Guidelines5/5

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

The description provides explicit guidance: 'This is the preferred search tool for most use cases. Use search_skills only when you need unfiltered results or specific type/agent filters.' This clearly defines when to use this tool vs the 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/loaditoutadmin/loaditout-mcp-server'

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