Skip to main content
Glama
theburgerllc

AI Development Pipeline MCP

by theburgerllc

read_project_file

Read files from the VS Code workspace directory to access project content for AI-assisted development tasks.

Instructions

Read a local file from the VS Code workspace (restricted to workspace directory)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • The async handler function for the 'read_project_file' tool. It validates the input path using validatePath helper, reads the file content using fs.readFileSync, and returns the content or an error message.
    async ({ path }) => {
      try {
        const safePath = validatePath(path);
        const content = fs.readFileSync(safePath, 'utf8');
        return { content: [{ type: 'text', text: content }] };
      } catch (err: any) {
        return { content: [{ type: 'text', text: `File read error: ${err.message}` }] };
      }
    }
  • Zod schema for the tool input, defining a required 'path' parameter as a string.
    { path: z.string() },
  • Registration of the 'read_project_file' tool on the MCP server, including name, description, schema, and handler.
    server.tool(
      'read_project_file',
      'Read a local file from the VS Code workspace (restricted to workspace directory)',
      { path: z.string() },
      async ({ path }) => {
        try {
          const safePath = validatePath(path);
          const content = fs.readFileSync(safePath, 'utf8');
          return { content: [{ type: 'text', text: content }] };
        } catch (err: any) {
          return { content: [{ type: 'text', text: `File read error: ${err.message}` }] };
        }
      }
    );
  • Helper function to securely resolve and validate file paths, ensuring they are within the workspace root to prevent path traversal attacks. Used by the read_project_file handler.
    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. It mentions the restriction to the workspace directory, which is useful behavioral context. However, it lacks details on error handling (e.g., what happens if the file doesn't exist), permissions, or return format, leaving significant gaps for a read operation tool.

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 ('Read a local file') and adds necessary context ('from the VS Code workspace') and restriction ('restricted to workspace directory') without any wasted words, making it highly concise 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 no annotations, 0% schema coverage, and no output schema, the description is incomplete. It covers the basic action and scope but misses critical details like parameter specifics, error behavior, and return values, which are essential for a file read tool in this context.

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?

Schema description coverage is 0%, with one parameter 'path' undocumented in the schema. The description adds minimal semantics by implying 'path' refers to a file path within the workspace, but doesn't specify format (e.g., relative vs. absolute), constraints, or examples, failing to compensate for the low coverage.

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 action ('Read') and resource ('a local file from the VS Code workspace'), making the purpose understandable. It distinguishes from siblings like 'write_project_file' by specifying read vs. write, but doesn't explicitly differentiate from 'check_file_exists' or 'list_directory_files' which also involve file operations.

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 it's for accessing files within the workspace. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'check_file_exists' for existence checks or 'list_directory_files' for directory listings, leaving usage somewhat ambiguous.

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