Skip to main content
Glama

vigile_search

Search the Vigile registry for MCP servers and agent skills by keyword to evaluate safety and trust scores of third-party tools.

Instructions

Search the Vigile registry for MCP servers and agent skills by keyword. Returns matching entries with trust scores. Use this when you need to find servers by description or capability.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (e.g., 'filesystem', 'database', 'code execution')
limitNoMax results to return (default: 10, max: 50)

Implementation Reference

  • The main handler function `searchRegistry` that executes the vigile_search tool logic. It searches the Vigile registry for MCP servers and agent skills by keyword, making parallel API calls to both endpoints, then formats the results into a markdown table with trust scores and levels.
    export async function searchRegistry(
      baseUrl: string,
      apiKey: string,
      query: string,
      limit?: number
    ): Promise<string> {
      const effectiveLimit = Math.min(limit || 10, 50);
      const qs = `q=${encodeURIComponent(query)}&limit=${effectiveLimit}`;
    
      // Search both servers and skills in parallel
      const [serverRes, skillRes] = await Promise.all([
        fetchVigile(baseUrl, apiKey, `/api/v1/search/?${qs}`),
        fetchVigile(baseUrl, apiKey, `/api/v1/search/skills?${qs}`),
      ]);
    
      const servers = serverRes.ok && Array.isArray(serverRes.data) ? serverRes.data : [];
      const skills = skillRes.ok && Array.isArray(skillRes.data) ? skillRes.data : [];
    
      if (servers.length === 0 && skills.length === 0) {
        return [
          `## Search: "${query}"`,
          "",
          "No results found in the Vigile registry.",
          "",
          "Try a different search term, or submit a server/skill for scanning at https://vigile.dev",
        ].join("\n");
      }
    
      const lines = [`## Search: "${query}"`, ""];
    
      // Server results
      if (servers.length > 0) {
        lines.push(`### MCP Servers (${servers.length} results)`, "");
        lines.push("| Server | Score | Level | Source |");
        lines.push("|--------|-------|-------|--------|");
        for (const s of servers) {
          const emoji = trustLevelEmoji(s.trust_level);
          lines.push(
            `| [${s.name}](https://vigile.dev/server/${encodeURIComponent(s.name)}) | ${formatScore(s.trust_score)} | ${emoji} ${s.trust_level} | ${s.source} |`
          );
        }
      }
    
      // Skill results
      if (skills.length > 0) {
        if (servers.length > 0) lines.push("");
        lines.push(`### Agent Skills (${skills.length} results)`, "");
        lines.push("| Skill | Score | Level | Platform |");
        lines.push("|-------|-------|-------|----------|");
        for (const s of skills) {
          const emoji = trustLevelEmoji(s.trust_level);
          lines.push(
            `| [${s.name}](https://vigile.dev/skill/${encodeURIComponent(s.name)}) | ${formatScore(s.trust_score)} | ${emoji} ${s.trust_level} | ${s.platform} |`
          );
        }
      }
    
      return lines.join("\n");
    }
  • src/index.ts:109-122 (registration)
    Registration of the vigile_search tool using `server.tool()`. Defines the tool name, description, and wires the handler to the `searchRegistry` function.
    // ── Tool: vigile_search ──
    
    server.tool(
      "vigile_search",
      "Search the Vigile registry for MCP servers and agent skills by keyword. Returns matching entries with trust scores. Use this when you need to find servers by description or capability.",
      {
        query: z.string().min(1).max(200).describe("Search query (e.g., 'filesystem', 'database', 'code execution')"),
        limit: z.number().int().min(1).max(50).optional().describe("Max results to return (default: 10, max: 50)"),
      },
      async ({ query, limit }) => {
        const result = await searchRegistry(API_BASE, API_KEY, query, limit);
        return { content: [{ type: "text" as const, text: result }] };
      }
    );
  • Zod schema definition for vigile_search inputs: `query` (required string, 1-200 chars) and `limit` (optional integer, 1-50).
    {
      query: z.string().min(1).max(200).describe("Search query (e.g., 'filesystem', 'database', 'code execution')"),
      limit: z.number().int().min(1).max(50).optional().describe("Max results to return (default: 10, max: 50)"),
    },
  • The `fetchVigile` helper function used by searchRegistry to make HTTP requests to the Vigile API. Handles authentication headers, error sanitization, and returns structured response data.
    export async function fetchVigile(
      baseUrl: string,
      apiKey: string,
      path: string,
      options?: { method?: string; body?: string }
    ): Promise<{ ok: boolean; status: number; data: any }> {
      const headers: Record<string, string> = {
        "Content-Type": "application/json",
        "User-Agent": "vigile-mcp/0.1.7",
      };
    
      if (apiKey) {
        headers["Authorization"] = `Bearer ${apiKey}`;
      }
    
      try {
        const res = await fetch(`${baseUrl}${path}`, {
          method: options?.method || "GET",
          headers,
          body: options?.body,
        });
    
        const data = await res.json().catch(() => null);
        return { ok: res.ok, status: res.status, data };
      } catch (error: any) {
        // Sanitize error message — don't leak internal details like
        // hostnames, ports, file paths, or stack traces
        const rawMsg = error?.message || "Unknown error";
        const safeMsg = rawMsg.includes("ECONNREFUSED") || rawMsg.includes("ENOTFOUND")
          ? "API server unreachable"
          : rawMsg.includes("ETIMEDOUT") || rawMsg.includes("timeout")
          ? "Request timed out"
          : rawMsg.includes("ECONNRESET")
          ? "Connection reset"
          : "Connection failed";
        return {
          ok: false,
          status: 0,
          data: { detail: safeMsg },
        };
      }
    }
  • Helper functions `trustLevelEmoji` and `formatScore` used by searchRegistry to format trust levels with emoji indicators and format numeric scores for display.
    export function trustLevelEmoji(level: string): string {
      switch (level) {
        case "trusted":
          return "🟢";
        case "caution":
          return "🟡";
        case "risky":
          return "🟠";
        case "dangerous":
          return "🔴";
        default:
          return "⚪";
      }
    }
    
    export function formatScore(score: number): string {
      return `${Math.round(score)}/100`;
    }
Behavior3/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 mentions that the tool 'Returns matching entries with trust scores,' which adds useful context about output behavior. However, it lacks details on potential side effects (e.g., rate limits, authentication needs, or data privacy implications), which are important for a search tool in a registry context.

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 with two sentences: the first states the purpose and output, and the second provides usage guidance. Every sentence adds value without redundancy, making it easy to parse and front-loaded with essential information.

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

Completeness3/5

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

Given the tool's moderate complexity (search function with two parameters), no annotations, and no output schema, the description is partially complete. It covers purpose and usage but lacks details on behavioral aspects like error handling, trust score interpretation, or result format. This leaves gaps for an AI agent to fully understand the tool's operation in context.

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 ('query' and 'limit') with descriptions and constraints. The description adds no additional parameter semantics beyond what's in the schema, such as examples of effective queries or implications of the limit parameter. Baseline 3 is appropriate when the schema handles parameter documentation adequately.

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: 'Search the Vigile registry for MCP servers and agent skills by keyword.' It specifies the verb ('Search'), resource ('Vigile registry'), and target ('MCP servers and agent skills'). However, it doesn't explicitly differentiate from sibling tools like 'vigile_scan_content' or 'vigile_check_server' beyond mentioning 'by keyword' versus other potential search methods.

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

Usage Guidelines4/5

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

The description provides clear guidance on when to use this tool: 'Use this when you need to find servers by description or capability.' This gives context for its application. However, it doesn't specify when not to use it or mention alternatives among the sibling tools, such as when to choose 'vigile_check_server' for specific server verification instead.

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/Vigile-ai/vigile-mcp'

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