Skip to main content
Glama
SobieskiCodes

MCP-Claude Code Bridge

read_file

Read file contents to access code, data, or configuration within Claude Code Bridge for debugging, analysis, or task execution.

Instructions

Read contents of a file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath to the file to read

Implementation Reference

  • The readFile method that implements the tool logic - reads a file from the working directory and returns its contents with formatting
    async readFile(filePath) {
      try {
        const fullPath = path.join(this.workingDir, filePath);
        const content = await fs.readFile(fullPath, 'utf8');
        
        return {
          content: [
            {
              type: "text",
              text: `Contents of ${filePath}:\n\n\`\`\`\n${content}\n\`\`\``
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error reading file: ${error.message}`
            }
          ]
        };
      }
    }
  • Tool schema definition for read_file - defines the name, description, and inputSchema with file_path parameter
    {
      name: "read_file",
      description: "Read contents of a file",
      inputSchema: {
        type: "object",
        properties: {
          file_path: {
            type: "string",
            description: "Path to the file to read"
          }
        },
        required: ["file_path"]
      }
    },
  • server.js:144-145 (registration)
    Tool routing in CallToolRequestSchema handler - routes 'read_file' requests to the readFile method
    case 'read_file':
      return await this.readFile(args.file_path);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Read contents of a file' implies a read operation but doesn't specify whether it requires specific permissions, what happens if the file doesn't exist (error behavior), whether it reads entire files or has size limits, or what format the contents are returned in. For a file operation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 communicates the core functionality without any wasted words. It's appropriately sized for a simple tool and gets straight to the point with no unnecessary elaboration or repetition.

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?

For a file reading tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what format the file contents are returned in (text, binary, encoding), whether there are size limitations, error conditions, or permission requirements. Given the complexity of file operations and the lack of structured metadata, the description should provide more operational context.

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 schema description coverage is 100%, with the single parameter 'file_path' clearly documented in the schema. The description doesn't add any parameter-specific information beyond what's already in the schema (e.g., no examples of valid paths, no mention of relative vs absolute paths). With complete schema coverage, the baseline score of 3 is appropriate as the description doesn't enhance parameter understanding.

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 contents') and resource ('a file'), making the purpose immediately understandable. It distinguishes from sibling tools like 'list_files' (which enumerates files) and 'create_project' (which creates resources). However, it doesn't specify what format the contents are returned in or any scope limitations, keeping it from 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 Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when reading a file is appropriate versus using 'list_files' to see what's available, or whether there are prerequisites like file existence or permissions. The agent must infer usage context entirely from the tool name and schema.

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/SobieskiCodes/claude-desktop-mcp-to-claude-agent'

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