Skip to main content
Glama

sswp_check_repo

Read-onlyIdempotent

Verify a repository is ready for attestation by checking directory existence, .git, package.json, and package-lock.json. Returns a status per condition and an overall READY or NOT READY verdict.

Instructions

Perform a lightweight repo health check without running the full witness pipeline. Verifies four conditions: the directory exists on disk, a .git directory is present (indicating a git repository), a package-lock.json exists (indicating locked dependencies), and a package.json exists (indicating a valid Node.js project). Returns a status line for each condition and an overall READY/NOT READY verdict. Use this as a fast pre-check in CI pipelines or before calling sswp_witness to ensure the repo is in a valid state. Does not seal an attestation or modify the registry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoPathYesAbsolute path to the project root directory to check. Must be a valid filesystem path.

Implementation Reference

  • Tool registration for 'sswp_check_repo' - defines name, description, annotations, and inputSchema (requires repoPath string). Listed in the ListToolsRequestSchema handler as one of the available SSWP MCP tools.
    {
      name: "sswp_check_repo",
      description:
        "Perform a lightweight repo health check without running the full witness pipeline. Verifies four conditions: the directory exists on disk, a .git directory is present (indicating a git repository), a package-lock.json exists (indicating locked dependencies), and a package.json exists (indicating a valid Node.js project). Returns a status line for each condition and an overall READY/NOT READY verdict. Use this as a fast pre-check in CI pipelines or before calling sswp_witness to ensure the repo is in a valid state. Does not seal an attestation or modify the registry.",
      annotations: {
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false
      },
      inputSchema: {
        type: "object",
        properties: { repoPath: { type: "string", description: "Absolute path to the project root directory to check. Must be a valid filesystem path." } },
        required: ["repoPath"]
      }
  • Handler function for 'sswp_check_repo'. Extracts repoPath from args, converts to WSL path via toWslPath(), performs four checks (exists, .git, package-lock.json, package.json), and returns a READY/NOT READY verdict based on whether the directory exists and has either package-lock.json or package.json.
    if (name === "sswp_check_repo") {
      const rawPath = (args as any).repoPath as string;
      const wsl = toWslPath(rawPath);
      const checks = {
        exists: existsSync(wsl),
        isGit: existsSync(resolve(wsl, ".git")),
        hasLockfile: existsSync(resolve(wsl, "package-lock.json")),
        hasPackageJson: existsSync(resolve(wsl, "package.json")),
      };
      const ok = checks.exists && (checks.hasLockfile || checks.hasPackageJson);
      const text = "Repo: " + wsl + "\n" +
        "  exists: " + checks.exists + "\n" +
        "  git: " + checks.isGit + "\n" +
        "  package-lock.json: " + checks.hasLockfile + "\n" +
        "  package.json: " + checks.hasPackageJson + "\n" +
        "  status: " + (ok ? "READY" : "NOT READY");
      return mkText(text, !ok);
    }
  • toWslPath helper function used by the sswp_check_repo handler to convert Windows paths to WSL /mnt/{drive}/ format before performing filesystem checks.
    export function toWslPath(winPath: string): string {
      // Already unix-style (no backslashes, no drive colon)
      const hasBackslash = winPath.includes(String.fromCharCode(92));
      const hasDrive = winPath.length >= 2 && winPath[1] === ':';
      if (!hasBackslash && !hasDrive) return winPath;
    
      // Replace backslashes with forward slashes
      let s = winPath;
      const bs = String.fromCharCode(92);
      while (s.includes(bs)) { s = s.replace(bs, "/"); }
    
      // Convert C:/ to /mnt/c/
      if (s.length >= 2 && s[1] === ':' && /^[A-Za-z]/.test(s[0])) {
        const drive = s[0].toLowerCase();
        s = '/mnt/' + drive + '/' + s.slice(2).replace(/^\/+/, '');
      }
      return s;
    }
Behavior5/5

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

The description adds significant behavioral context beyond annotations: it lists the four conditions checked, explicitly states it does not seal an attestation or modify the registry, and confirms idempotency without side effects. No contradiction with annotations (readOnlyHint true, destructiveHint false, idempotentHint true).

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 four sentences, front-loaded with the main purpose, and every sentence adds value. No unnecessary words or repetition.

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?

For a simple tool with one parameter and no output schema, the description fully covers what the tool does, what it checks, what it returns (status lines and verdict), and when to use it. No gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with a clear description for repoPath. The tool description reinforces that it must be an absolute path to the project root, adding minimal but helpful context beyond the schema.

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 performs a lightweight repo health check by verifying four specific conditions (directory exists, .git directory, package-lock.json, package.json) and provides a READY/NOT READY verdict. This distinguishes it from siblings like sswp_witness, which runs the full pipeline.

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 explicitly recommends use as a fast pre-check in CI pipelines or before calling sswp_witness. It does not explicitly state when not to use, but the context and sibling names imply alternatives for full attestation or other checks.

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/VrtxOmega/sswp-mcp'

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