Skip to main content
Glama

superdesign_check_files

Detect file changes by comparing current workspace files against a provided manifest, enabling gallery refresh integration for design workflows.

Instructions

Check for file changes by comparing current files with a manifest (for gallery refresh integration)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_pathNoWorkspace path (defaults to current directory)
manifestYesFile manifest to compare against

Implementation Reference

  • Input schema definition for the superdesign_check_files tool
    const CheckFilesSchema = z.object({
      workspace_path: z.string().optional().describe("Workspace path (defaults to current directory)"),
      manifest: z.array(z.object({
        name: z.string(),
        size: z.number(),
        modified: z.number()
      })).describe("File manifest to compare against")
    });
  • src/index.ts:2048-2069 (registration)
    Registration of the superdesign_check_files tool in the list of available tools
    name: "superdesign_check_files",
    description: "Check for file changes by comparing current files with a manifest (for gallery refresh integration)",
    inputSchema: {
      type: "object",
      properties: {
        workspace_path: { type: "string", description: "Workspace path (defaults to current directory)" },
        manifest: {
          type: "array",
          items: {
            type: "object",
            properties: {
              name: { type: "string" },
              size: { type: "number" },
              modified: { type: "number" }
            },
            required: ["name", "size", "modified"]
          },
          description: "File manifest to compare against"
        }
      },
      required: ["manifest"],
    },
  • Handler that processes superdesign_check_files tool calls: validates input with CheckFilesSchema, computes changes using checkFileChanges, returns JSON with hasChanges and changes list
    case "superdesign_check_files": {
      const { workspace_path, manifest } = CheckFilesSchema.parse(args);
      
      try {
        const superdesignDir = getSuperdeignDirectory(workspace_path);
        const designIterationsDir = path.join(superdesignDir, 'design_iterations');
        
        if (!existsSync(designIterationsDir)) {
          return {
            content: [{ type: "text", text: JSON.stringify({ hasChanges: false, changes: [], error: "No design iterations directory found" }) }],
          };
        }
        
        const result = checkFileChanges(superdesignDir, manifest);
        
        return {
          content: [{ type: "text", text: JSON.stringify(result) }],
        };
      } catch (error: any) {
        return {
          content: [{ type: "text", text: JSON.stringify({ hasChanges: false, changes: [], error: error.message }) }],
        };
      }
    }
  • Core logic that scans current design files (*.html, *.svg), compares against manifest by name/size/mtime, detects and categorizes changes as added/modified/deleted
    function checkFileChanges(superdesignDir: string, manifest: Array<{name: string; size: number; modified: number}>): {hasChanges: boolean; changes: Array<{file: string; type: 'added' | 'modified' | 'deleted'}>} {
      const designIterationsDir = path.join(superdesignDir, 'design_iterations');
      const currentFiles = glob.sync('*.{html,svg}', { cwd: designIterationsDir });
      const changes: Array<{file: string; type: 'added' | 'modified' | 'deleted'}> = [];
      
      // Check for new or modified files
      currentFiles.forEach(file => {
        const filePath = path.join(designIterationsDir, file);
        if (existsSync(filePath)) {
          const stats = statSync(filePath);
          const manifestEntry = manifest.find(m => m.name === file);
          
          if (!manifestEntry) {
            // New file
            changes.push({ file, type: 'added' });
          } else if (stats.size !== manifestEntry.size || stats.mtime.getTime() !== manifestEntry.modified) {
            // Modified file
            changes.push({ file, type: 'modified' });
          }
        }
      });
      
      // Check for deleted files
      manifest.forEach(manifestEntry => {
        if (!currentFiles.includes(manifestEntry.name)) {
          changes.push({ file: manifestEntry.name, type: 'deleted' });
        }
      });
      
      return {
        hasChanges: changes.length > 0,
        changes
      };
    }
Behavior2/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 'check for file changes' and 'comparing,' implying a read-only operation, but doesn't clarify if it modifies files, requires specific permissions, has rate limits, or what the output looks like (e.g., a list of changed files). For a tool with no annotations, this leaves significant gaps in understanding its behavior and safety.

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 a single, efficient sentence that front-loads the core purpose ('Check for file changes') and adds context ('for gallery refresh integration'). There is no wasted text, and it's appropriately sized for the tool's complexity, making it easy to parse and understand quickly.

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

Completeness2/5

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

Given the tool's complexity (involving file comparison and integration), lack of annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns (e.g., a list of changed files, a status), potential side effects, or error conditions. For a tool with no structured behavioral data, more detail is needed to ensure safe and correct usage by an AI agent.

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 has 100% description coverage, with clear documentation for both parameters ('workspace_path' and 'manifest'). The description adds minimal value beyond the schema, as it doesn't explain parameter usage, formats, or constraints (e.g., how 'manifest' should be structured beyond the schema). Baseline is 3 since the schema does the heavy lifting, but no extra semantic insights are provided.

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: 'Check for file changes by comparing current files with a manifest.' It specifies the verb ('check for file changes') and resource ('files'), and mentions the context ('for gallery refresh integration'). However, it doesn't explicitly differentiate from sibling tools like 'superdesign_list' or 'superdesign_gallery', which might have overlapping file-related functions.

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 in the context of 'gallery refresh integration,' suggesting it's for detecting changes to update a gallery. However, it doesn't provide explicit guidance on when to use this tool versus alternatives (e.g., 'superdesign_list' for listing files or 'superdesign_gallery' for gallery operations), nor does it specify prerequisites or exclusions. The context is clear but lacks comparative guidance.

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/jonthebeef/superdesign-mcp-claude-code'

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