get_repository_docs
Retrieve GitHub repository documentation by specifying owner and repository name to access project information and guides.
Instructions
Get documentation for a specific GitHub repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner/organization | |
| repo | Yes | Repository name | |
| force_refresh | No | Force refresh cached documentation |
Implementation Reference
- src/server.ts:151-165 (handler)MCP tool handler for 'get_repository_docs' that validates input, calls CodeWikiClient.getRepositoryDocs, and returns the parsed documentation as JSON text content.case 'get_repository_docs': { const { owner, repo, force_refresh = false } = args as any; if (!owner || !repo) { throw new Error('Owner and repo are required'); } const docs = await codeWikiClient.getRepositoryDocs(owner, repo, force_refresh); return { content: [ { type: 'text', text: JSON.stringify(docs, null, 2), }, ], }; }
- src/server.ts:56-77 (registration)Tool registration in ListTools handler, including name, description, and input schema definition.name: 'get_repository_docs', description: 'Get documentation for a specific GitHub repository', inputSchema: { type: 'object', properties: { owner: { type: 'string', description: 'Repository owner/organization', }, repo: { type: 'string', description: 'Repository name', }, force_refresh: { type: 'boolean', description: 'Force refresh cached documentation', default: false, }, }, required: ['owner', 'repo'], }, },
- src/codewiki-client.ts:31-41 (schema)TypeScript interface defining the structure of the parsed documentation returned by the tool.export interface ParsedDocumentation { repository: RepositoryInfo; sections: DocumentationSection[]; lastUpdated: Date; metadata: { totalSections: number; hasDiagrams: boolean; hasApiDocs: boolean; hasArchitecture: boolean; }; }
- src/codewiki-client.ts:84-100 (helper)Main helper method implementing the logic to retrieve (cached or fresh), parse, and return repository documentation via CodeWikiClient.async getRepositoryDocs(owner: string, repo: string, forceRefresh = false): Promise<ParsedDocumentation> { // Check cache first unless force refresh if (!forceRefresh) { const cached = await this.cacheManager.get(owner, repo); if (cached) { return this.parseCachedDocumentation(cached); } } // Fetch fresh documentation const documentation = await this.fetchDocumentation(owner, repo); // Cache the raw content await this.cacheManager.set(owner, repo, documentation); return this.parseDocumentation(documentation); }