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
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to the file to read |
Implementation Reference
- server.js:258-281 (handler)The readFile method that implements the tool logic - reads a file from the working directory and returns its contents with formattingasync 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}` } ] }; } }
- server.js:93-106 (schema)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 methodcase 'read_file': return await this.readFile(args.file_path);