read_doc
Access Laravel documentation files to retrieve specific implementation details, coding rules, or design system guides for development tasks.
Instructions
Read a specific documentation file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to the documentation file relative to docs root |
Implementation Reference
- index.js:105-120 (handler)The read_doc tool handler function that reads a specific documentation file. It takes a file_path parameter, validates the file exists, reads its content using fs.readFileSync, and returns it as text content.
async ({ file_path }) => { const filePath = path.join(DOCS_PATH, file_path); if (!fs.existsSync(filePath)) { throw new Error(`Documentation file not found: ${file_path}`); } const content = fs.readFileSync(filePath, 'utf-8'); return { content: [{ type: 'text', text: content, }], }; } - index.js:97-121 (registration)Complete registration of the read_doc tool with the MCP server, including the tool name, description, input schema, and handler function.
server.registerTool( 'read_doc', { description: 'Read a specific documentation file', inputSchema: { file_path: z.string().describe('Path to the documentation file relative to docs root'), }, }, async ({ file_path }) => { const filePath = path.join(DOCS_PATH, file_path); if (!fs.existsSync(filePath)) { throw new Error(`Documentation file not found: ${file_path}`); } const content = fs.readFileSync(filePath, 'utf-8'); return { content: [{ type: 'text', text: content, }], }; } ); - index.js:101-103 (schema)Input schema definition for the read_doc tool, specifying that it requires a file_path string parameter.
inputSchema: { file_path: z.string().describe('Path to the documentation file relative to docs root'), },