get_project_readme
Retrieve README content from GitHub projects to understand project documentation and setup requirements.
Instructions
Get the README content of a GitHub project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes |
Implementation Reference
- The core handler method that executes a GraphQL query to fetch the README content for the specified GitHub project.async getProjectReadme(data: { projectId: string; }): Promise<{ readme: string }> { try { const query = ` query($projectId: ID!) { node(id: $projectId) { ... on ProjectV2 { readme } } } `; interface GetReadmeResponse { node: { readme: string | null; }; } const response = await this.factory.graphql<GetReadmeResponse>(query, { projectId: data.projectId }); return { readme: response.node?.readme || '' }; } catch (error) { throw this.mapErrorToMCPError(error); } }
- Zod schema definition and ToolDefinition object for input validation, description, and usage examples.export const getProjectReadmeTool: ToolDefinition<GetProjectReadmeArgs> = { name: "get_project_readme", description: "Get the README content of a GitHub project", schema: getProjectReadmeSchema as unknown as ToolSchema<GetProjectReadmeArgs>, examples: [ { name: "Get project README", description: "Retrieve the README for a project", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH" } } ] };
- src/infrastructure/tools/ToolRegistry.ts:198-198 (registration)Registers the getProjectReadmeTool in the central ToolRegistry singleton instance.this.registerTool(getProjectReadmeTool);
- src/index.ts:274-275 (registration)Dispatch handler in main MCP server that routes tool calls to the ProjectManagementService.case "get_project_readme": return await this.service.getProjectReadme(args);