Skip to main content
Glama

check_pins

Detects skill file rug pull drift by verifying SHA-256 hashes against stored pins. Reports files changed after last audit.

Instructions

Check a directory for skill file rug pull drift.

Compares current SHA-256 hashes of skill files against the pins stored in .bawbel-pins.json. Reports any files that changed after the last audit.

Run bawbel pin from the CLI to create the initial pin file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory to check (default: current directory).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The check_pins function is the handler for the 'check_pins' tool. It runs 'bawbel check-pins' via subprocess, parses JSON output, and reports which pinned skill files have drifted (changed SHA-256 hashes).
    def check_pins(path: str = ".") -> str:
        """
        Check a directory for skill file rug pull drift.
    
        Compares current SHA-256 hashes of skill files against the pins
        stored in .bawbel-pins.json. Reports any files that changed after
        the last audit.
    
        Run bawbel pin <path> from the CLI to create the initial pin file.
    
        Args:
            path: Directory to check (default: current directory)
        """
        result = subprocess.run(  # nosec B603  # noqa: S603
            ["bawbel", "check-pins", path, "--format", "json"],
            capture_output=True,
            text=True,
            timeout=30,
        )
    
        raw = result.stdout.strip()
        if not raw:
            stderr = result.stderr.strip()
            if "No pin file found" in stderr or result.returncode == 1:
                return (
                    f"No .bawbel-pins.json found in {path}.\n"
                    "Run 'bawbel pin <path>' from the CLI to create initial pins."
                )
            return stderr or "No output from pin check"
    
        try:
            data = json.loads(raw)
        except json.JSONDecodeError:
            return raw
    
        drifted = data.get("drifted", [])
        pinned = data.get("pinned_count", 0)
        status = data.get("status", "")
    
        if not drifted:
            return f"Clean: all {pinned} pinned files match their stored hashes."
    
        lines = [
            f"DRIFT DETECTED: {len(drifted)} of {pinned} files changed",
            "",
        ]
        for f in drifted:
            lines.append(f"  {f.get('file', '')}")
            lines.append(f"    Pinned:  {f.get('pinned_hash', '')[:16]}...")
            lines.append(f"    Current: {f.get('current_hash', '')[:16]}...")
            lines.append("")
    
        lines.append(
            "Action: review the changed files with 'bawbel report <file>'. "
            "If safe, re-pin with 'bawbel pin --update <file>'."
        )
    
        return "\n".join(lines)
  • The @mcp.tool() decorator registers check_pins as an MCP tool on the FastMCP instance named 'Bawbel Scanner'.
    @mcp.tool()
  • The schema for check_pins is defined by the function signature and docstring. It takes one optional string parameter 'path' (default '.') representing the directory to check.
    def check_pins(path: str = ".") -> str:
        """
        Check a directory for skill file rug pull drift.
    
        Compares current SHA-256 hashes of skill files against the pins
        stored in .bawbel-pins.json. Reports any files that changed after
        the last audit.
    
        Run bawbel pin <path> from the CLI to create the initial pin file.
    
        Args:
            path: Directory to check (default: current directory)
        """
Behavior3/5

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

Description explains the comparison process (SHA-256 hashes vs .bawbel-pins.json) and output (reports changed files). However, with no annotations, it misses details like whether the tool is read-only, error handling, or requirement for the pin file to exist.

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?

Description is 4 sentences, front-loaded with purpose, then mechanism, output, and setup step. Every sentence adds value with no redundancy.

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?

For a simple one-parameter tool with an output schema, the description covers the core behavior and preconditions. It lacks details on output format, but the output schema likely handles that.

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%, so baseline is 3. Description reinforces the path parameter as 'Directory to check' but adds no extra semantic detail beyond the schema's own description.

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?

Description clearly states the tool checks a directory for skill file rug pull drift using SHA-256 hashes. It specifies the resource (directory) and the action (check for drift), distinguishing it from sibling tools like check_conformance or scan_content.

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?

Description implies the tool should be used after creating a pin file via CLI ('Run bawbel pin <path> from the CLI'). It provides clear context but does not explicitly exclude when not to use or mention alternatives.

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/bawbel/bawbel-mcp'

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