Skip to main content
Glama
theburgerllc

AI Development Pipeline MCP

by theburgerllc

check_file_exists

Verify whether a specific file exists within your workspace directory to prevent errors in development workflows.

Instructions

Check if a local file exists (restricted to workspace directory)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • The main handler function for the 'check_file_exists' tool. It validates the input path using validatePath, then uses fs.existsSync to check if the file exists, returning a text response indicating existence or not.
    async ({ path }) => {
      try {
        const safePath = validatePath(path);
        const exists = fs.existsSync(safePath);
        return { content: [{ type: 'text', text: exists ? 'File exists' : 'File does not exist' }] };
      } catch (err: any) {
        return { content: [{ type: 'text', text: `File check error: ${err.message}` }] };
      }
    }
  • Registration of the 'check_file_exists' tool on the MCP server, including name, description, schema, and handler.
    server.tool(
      'check_file_exists',
      'Check if a local file exists (restricted to workspace directory)',
      { path: z.string() },
      async ({ path }) => {
        try {
          const safePath = validatePath(path);
          const exists = fs.existsSync(safePath);
          return { content: [{ type: 'text', text: exists ? 'File exists' : 'File does not exist' }] };
        } catch (err: any) {
          return { content: [{ type: 'text', text: `File check error: ${err.message}` }] };
        }
      }
    );
  • Input schema for the tool: requires a 'path' parameter as a string, validated with Zod.
    { path: z.string() },
  • Helper function used by the tool to validate and resolve the file path, preventing path traversal attacks by ensuring it stays within the workspace root.
    function validatePath(filePath: string): string {
      const resolvedPath = path.resolve(WORKSPACE_ROOT, filePath);
      if (!resolvedPath.startsWith(WORKSPACE_ROOT)) {
        throw new Error('Path traversal detected - access denied');
      }
      return resolvedPath;
    }
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 states the tool checks file existence and is restricted to the workspace directory, which adds some context about scope. However, it doesn't describe what the tool returns (e.g., boolean, error messages), whether it requires specific permissions, or any rate limits. For a tool with zero annotation coverage, this is a significant gap in behavioral transparency.

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 is front-loaded with the core purpose ('Check if a local file exists') and includes essential context ('restricted to workspace directory'). There is zero waste, and every word earns its place, making it appropriately sized and well-structured.

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 (simple existence check), no annotations, no output schema, and low schema description coverage (0%), the description is incomplete. It doesn't explain the return value (e.g., success/failure indicators), error handling, or detailed parameter usage. For a tool with no structured data support, the description should provide more context to be fully helpful.

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

Parameters2/5

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

The input schema has 1 parameter ('path') with 0% description coverage, meaning the schema provides no details about the parameter. The description doesn't add any meaning beyond what's implied by the tool name; it doesn't explain what 'path' should be (e.g., relative to workspace, file extension requirements). With low schema coverage, the description fails to compensate adequately, leaving the parameter semantics unclear.

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 with a specific verb ('Check') and resource ('local file'), and specifies the scope ('restricted to workspace directory'). It distinguishes from siblings like 'list_directory_files' (which lists files) and 'read_project_file' (which reads content), but doesn't explicitly differentiate from them. The purpose is clear but lacks explicit sibling differentiation.

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 context by mentioning 'restricted to workspace directory', suggesting when to use it (for local file existence checks within the workspace). However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'list_directory_files' (for listing files) or 'read_project_file' (for reading files), nor does it mention prerequisites or exclusions. Usage is implied but not fully articulated.

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/theburgerllc/ai-development-pipeline-mcp'

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