Skip to main content
Glama

search

Find AI tools, frameworks, APIs, MCP servers, and agents using the Unfragile match graph. Returns ranked results with capability matches and graph signals.

Instructions

Search the Unfragile match graph for AI tools, frameworks, APIs, MCP servers, agents, and more. Returns ranked results with capability matches and graph signals. Every query feeds the graph.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesWhat you're looking for (e.g., 'best framework for building AI agents', 'MCP server for database access')
limitNoMax results to return
typeNoFilter by artifact type

Implementation Reference

  • The handler function for the 'search' tool. It receives {query, limit, type} parameters, calls searchAPI(), formats results via formatResults(), and returns the text content. This is the core execution logic of the tool.
    server.tool(
      "search",
      "Search the Unfragile match graph for AI tools, frameworks, APIs, MCP servers, agents, and more. Returns ranked results with capability matches and graph signals. Every query feeds the graph.",
      {
        query: z.string().min(2).max(500).describe("What you're looking for (e.g., 'best framework for building AI agents', 'MCP server for database access')"),
        limit: z.number().min(1).max(20).default(5).describe("Max results to return"),
        type: z.enum(["agent", "api", "app", "benchmark", "cli", "dataset", "extension", "finetune", "framework", "mcp", "model", "platform", "product", "prompt", "repo", "skill", "template", "webapp", "workflow"]).optional().describe("Filter by artifact type"),
      },
      async ({ query, limit, type }) => {
        log("search", query);
        try {
          const data = await searchAPI(query, { limit, type });
          return { content: [{ type: "text" as const, text: formatResults(data) }] };
        } catch (err) {
          return { content: [{ type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}` }], isError: true };
        }
      }
    );
  • TypeScript interfaces for the search API response: SearchMatch (individual result with artifact, capabilities, matchGraph, compositeScore, matchProof) and SearchResponse (query, intent, matches, matchCount, graphSignal). These define the shape of data returned from the search API.
    interface SearchMatch {
      artifact: {
        id: string;
        name: string;
        type: string;
        url: string;
        slug: string;
        description: string;
        categories: string[];
        pricing: { model: string; free: boolean };
        verified: boolean;
        unfragileRank: number;
        pageUrl: string;
      };
      capabilities: Array<{
        name: string;
        description: string;
        matchScore: number;
        bestFor: string[];
        limitations: string[];
      }>;
      matchGraph: {
        timesMatched: number;
        successRate: number;
        topIntents: string[];
      };
      compositeScore: number;
      matchProof?: {
        reasoning: string;
        confidence: { score: number; percentile: number; topDimension: string };
        evidence: { timesMatched: number; successRate: number; topIntents: string[] };
      };
    }
    
    interface SearchResponse {
      query: string;
      intent: { type: string; category: string; refined: string };
      matches: SearchMatch[];
      matchCount: number;
      graphSignal: {
        gapDetected: boolean;
        queryId: string;
        matchRecordIds?: string[];
      };
    }
  • src/index.ts:428-445 (registration)
    Registration of the 'search' tool on the MCP server using server.tool(). This registers the tool name 'search', its description, input schema (zod-defined), and the async handler function.
    server.tool(
      "search",
      "Search the Unfragile match graph for AI tools, frameworks, APIs, MCP servers, agents, and more. Returns ranked results with capability matches and graph signals. Every query feeds the graph.",
      {
        query: z.string().min(2).max(500).describe("What you're looking for (e.g., 'best framework for building AI agents', 'MCP server for database access')"),
        limit: z.number().min(1).max(20).default(5).describe("Max results to return"),
        type: z.enum(["agent", "api", "app", "benchmark", "cli", "dataset", "extension", "finetune", "framework", "mcp", "model", "platform", "product", "prompt", "repo", "skill", "template", "webapp", "workflow"]).optional().describe("Filter by artifact type"),
      },
      async ({ query, limit, type }) => {
        log("search", query);
        try {
          const data = await searchAPI(query, { limit, type });
          return { content: [{ type: "text" as const, text: formatResults(data) }] };
        } catch (err) {
          return { content: [{ type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}` }], isError: true };
        }
      }
    );
  • The searchAPI() helper function. Makes an HTTP GET request to the Unfragile /api/v1/search endpoint with query params (q, source, limit, type, proof=true). Handles authentication, timeout (15s), error handling, and returns parsed SearchResponse JSON.
    async function searchAPI(
      query: string,
      options: { limit?: number; type?: string } = {}
    ): Promise<SearchResponse> {
      const params = new URLSearchParams({ q: query, source: SOURCE });
      if (options.limit) params.set("limit", String(options.limit));
      if (options.type) params.set("type", options.type);
    
      const headers: Record<string, string> = { Accept: "application/json" };
      if (API_KEY) headers["X-API-Key"] = API_KEY;
    
      const controller = new AbortController();
      const timeout = setTimeout(() => controller.abort(), 15_000);
    
      try {
        const res = await fetch(`${API_BASE}/api/v1/search?${params}&proof=true`, {
          headers,
          signal: controller.signal,
        });
    
        if (!res.ok) {
          const text = await res.text();
          throw new Error(`Unfragile API error ${res.status}: ${text}`);
        }
    
        const contentType = res.headers.get("content-type") || "";
        if (!contentType.includes("application/json")) {
          throw new Error(
            `Unfragile API returned ${contentType} instead of JSON. The API may be down or returning an error page.`
          );
        }
    
        return res.json() as Promise<SearchResponse>;
      } finally {
        clearTimeout(timeout);
      }
    }
  • The formatResults() helper function. Takes a SearchResponse and formats it into a human-readable markdown string showing the search query, intent, match count, and each match with capabilities, match proof, and graph signals.
    function formatResults(data: SearchResponse): string {
      const lines: string[] = [];
      lines.push(`# Search: "${data.query}"`);
      lines.push(`Intent: ${data.intent.type} | Category: ${data.intent.category || "general"}`);
      lines.push(`Found: ${data.matchCount} matches\n`);
    
      if (data.matches.length === 0) {
        lines.push("No matches found. This gap has been recorded — the Unfragile graph learns from every query.");
        return lines.join("\n");
      }
    
      for (let i = 0; i < data.matches.length; i++) {
        lines.push(formatMatch(data.matches[i], i + 1));
        lines.push("");
      }
    
      // Include matchRecordIds for feedback
      const ids = data.graphSignal.matchRecordIds;
      if (ids && ids.length > 0) {
        lines.push(`\n_Match record IDs (for feedback): ${ids.join(", ")}_`);
      }
    
      return lines.join("\n");
    }
Behavior3/5

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

No annotations are provided, so the description must convey all behavioral traits. It mentions that 'every query feeds the graph,' implying a side effect (likely mutating the graph), but does not clarify if this is destructive or requires permissions. The description is vague about the nature of this side effect and lacks details on safety, rate limits, or return structure.

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 only two sentences, front-loading the primary action and output. Every sentence adds value: the first defines what is searched, the second explains the output and a key behavioral note. There is no redundancy or wasted words.

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

Completeness4/5

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

Given no output schema, the description offers a reasonable summary of return values ('ranked results with capability matches and graph signals'). It also hints at the side effect of feeding the graph. However, it lacks detail on output format or fields, which would be beneficial for agent understanding.

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 input schema covers all parameters with detailed descriptions (100% coverage). The description adds no additional semantic information beyond what the schema provides, 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.

Purpose5/5

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

The description clearly states the tool searches the Unfragile match graph for a wide range of artifacts, with ranked results. The verb 'Search' and specific resource 'Unfragile match graph' make the purpose unambiguous, and it distinguishes itself from more specific sibling tools like find_mcps or find_stack.

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 does not explicitly state when to use this tool versus alternatives. It is a general search tool, so usage is implied, but no exclusion criteria or guidance on choosing between siblings like 'find_mcps' or 'resolve_capability' is provided.

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/Savirinc/unfragile-mcp-server'

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