Skip to main content
Glama
talentedmrweb

Local Dev Bridge MCP

read_file

View existing code files by reading contents from the local file system. Access files using relative or absolute paths to examine project code.

Instructions

Read the contents of a file from the local file system. Use this to view existing code files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the file (relative to projects directory or absolute)

Implementation Reference

  • The readFile method implements the core logic of the 'read_file' tool. It resolves the file path using resolvePath, reads the file contents with fs.readFile, and returns the content formatted as MCP response.
    async readFile(filePath) {
      const resolvedPath = this.resolvePath(filePath);
      const content = await fs.readFile(resolvedPath, 'utf-8');
      return {
        content: [
          {
            type: 'text',
            text: content,
          },
        ],
      };
    }
  • The input schema for the 'read_file' tool, defining the required 'path' parameter as a string.
    inputSchema: {
      type: 'object',
      properties: {
        path: {
          type: 'string',
          description: 'Path to the file (relative to projects directory or absolute)',
        },
      },
      required: ['path'],
    },
  • index.js:47-60 (registration)
    Registration of the 'read_file' tool in the ListToolsRequest handler, providing name, description, and input schema.
    {
      name: 'read_file',
      description: 'Read the contents of a file from the local file system. Use this to view existing code files.',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: 'Path to the file (relative to projects directory or absolute)',
          },
        },
        required: ['path'],
      },
    },
  • index.js:163-164 (registration)
    Dispatch handler in the CallToolRequest switch statement that routes 'read_file' calls to the readFile method.
    case 'read_file':
      return await this.readFile(args.path);
  • Helper method resolvePath used by readFile to handle relative and absolute paths relative to PROJECTS_DIR.
    resolvePath(inputPath) {
      if (!inputPath || inputPath === '.') {
        return PROJECTS_DIR;
      }
      if (path.isAbsolute(inputPath)) {
        return inputPath;
      }
      return path.join(PROJECTS_DIR, inputPath);
    }
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 reads files but doesn't mention potential issues like file permissions, errors for non-existent files, encoding handling, or output format. For a file system tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves in practice.

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 front-loaded with the core purpose in the first sentence and uses a second sentence to add context efficiently. Both sentences earn their place by clarifying usage without waste, 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.

Completeness3/5

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

Given the tool's low complexity (single parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and usage but lacks details on behavioral aspects like error handling or output format, which would be helpful for an agent to use it correctly in varied scenarios.

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 the 'path' parameter well-documented in the schema itself. The description adds no additional meaning beyond what the schema provides (e.g., no examples or constraints), so it meets the baseline score of 3 where the schema does the heavy lifting.

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 verb ('Read') and resource ('contents of a file from the local file system'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'search_files' or 'list_directory' beyond the general 'view existing code files' context, which is why it doesn't reach a perfect score.

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 provides some implied usage guidance with 'Use this to view existing code files,' which suggests a context for reading code files. However, it lacks explicit when-to-use vs. alternatives (e.g., compared to 'search_files' for finding files or 'edit_file' for modifying them), and no exclusions or prerequisites are mentioned, making it only moderately helpful.

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/talentedmrweb/local-dev-bridge-mcp'

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