Skip to main content
Glama

vigile_scan_content

Scan agent skill file content for security issues. Submit raw content from .md or .rules files for analysis to get trust score and detailed findings.

Instructions

Scan the content of an agent skill file for security issues. Submit raw content from a claude.md, .cursorrules, skill.md, or similar file for analysis. Returns trust score and detailed findings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesThe raw text content to scan (max 100KB)
file_typeNoFile type: skill.md, claude.md, cursorrules, mdc-rule (default: skill.md)
nameNoOptional name for the scan result

Implementation Reference

  • The core handler function that POSTs content to /api/v1/scan/skill and formats the response including trust score, findings, and recommendations.
    export async function scanContent(
      baseUrl: string,
      apiKey: string,
      content: string,
      fileType?: string,
      name?: string
    ): Promise<string> {
      const body = {
        skill_name: name || "inline-scan",
        content,
        file_type: fileType || "skill.md",
        platform: "claude-code",
        source: "mcp-scan",
      };
    
      const { ok, status, data } = await fetchVigile(baseUrl, apiKey, "/api/v1/scan/skill", {
        method: "POST",
        body: JSON.stringify(body),
      });
    
      if (!ok) {
        if (status === 429) {
          return [
            "**Scan quota exceeded.**",
            "",
            data?.detail || "You've reached your monthly scan limit.",
            "",
            "Upgrade your plan at https://vigile.dev/pricing for more scans.",
          ].join("\n");
        }
        return `Scan failed: ${data?.detail || `HTTP ${status}`}`;
      }
    
      const emoji = trustLevelEmoji(data.trust_level);
      const lines = [
        `## ${emoji} Scan Result: ${data.skill_name || name || "Inline Scan"}`,
        "",
        `**Trust Score:** ${formatScore(data.trust_score)}`,
        `**Trust Level:** ${data.trust_level}`,
        `**File Type:** ${data.file_type}`,
        `**Findings:** ${data.findings_count} total (${data.critical_count} critical, ${data.high_count} high)`,
      ];
    
      // Detailed findings
      if (data.findings && data.findings.length > 0) {
        lines.push("", "### Findings");
        for (const f of data.findings) {
          const severity = f.severity === "critical" ? "🔴" : f.severity === "high" ? "🟠" : "🟡";
          lines.push(``, `#### ${severity} [${f.severity.toUpperCase()}] ${f.title}`);
          lines.push(f.description);
          if (f.evidence) {
            lines.push(`**Evidence:** \`${f.evidence}\``);
          }
          if (f.recommendation) {
            lines.push(`**Recommendation:** ${f.recommendation}`);
          }
        }
      } else {
        lines.push("", "✅ No security findings detected.");
      }
    
      return lines.join("\n");
    }
  • src/index.ts:84-96 (registration)
    Registers the 'vigile_scan_content' tool with the MCP server, defining input schema (content, file_type, name) and delegating to the scanContent handler.
    server.tool(
      "vigile_scan_content",
      "Scan the content of an agent skill file for security issues. Submit raw content from a claude.md, .cursorrules, skill.md, or similar file for analysis. Returns trust score and detailed findings.",
      {
        content: z.string().min(1).max(100_000).describe("The raw text content to scan (max 100KB)"),
        file_type: z.string().min(1).max(30).optional().describe("File type: skill.md, claude.md, cursorrules, mdc-rule (default: skill.md)"),
        name: z.string().min(1).max(200).optional().describe("Optional name for the scan result"),
      },
      async ({ content, file_type, name }) => {
        const result = await scanContent(API_BASE, API_KEY, content, file_type, name);
        return { content: [{ type: "text" as const, text: result }] };
      }
    );
  • Zod validation schema for the tool's inputs: required content (1-100K chars), optional file_type and name.
    {
      content: z.string().min(1).max(100_000).describe("The raw text content to scan (max 100KB)"),
      file_type: z.string().min(1).max(30).optional().describe("File type: skill.md, claude.md, cursorrules, mdc-rule (default: skill.md)"),
      name: z.string().min(1).max(200).optional().describe("Optional name for the scan result"),
    },
  • Generic fetch helper used by scanContent to call the Vigile API. Handles auth headers, JSON requests, and sanitized error messages.
    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 to format trust level as emoji and trust score as percentage string.
    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`;
    }
Behavior2/5

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

No annotations exist, so the description must disclose behavioral traits. It mentions no side effects, authentication needs, or whether content is stored/transmitted. It only describes the output, leaving safety and privacy implications unclear.

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?

Two concise sentences, no redundancy. Every piece of information is relevant and front-loaded. Efficiently communicates purpose and input format.

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 high schema coverage, no output schema, and a straightforward task (scan content), the description provides sufficient context: what to submit, what it does, and what is returned. No gaps remain.

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 coverage is 100%, with each parameter having a description. The tool description adds little beyond the schema, such as mentioning file types already covered in file_type's description. No additional meaning or constraints are introduced.

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 specifies the action ('scan'), the resource ('content of an agent skill file'), and the purpose ('for security issues'). It provides concrete file type examples and states the output ('trust score and detailed findings'), effectively differentiating from sibling tools like vigile_check_skill.

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 implies usage when a user has raw content to analyze, but it does not contrast with sibling tools (e.g., vs vigile_check_skill for existing skills) or specify when not to use it. Some guidance on prerequisites or alternatives is missing.

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