update_repository
Force update cached FedRAMP documentation repository to fetch latest data from GitHub, bypassing the automatic 24-hour refresh cycle for immediate access to updated compliance requirements and security controls.
Instructions
Force update the cached FedRAMP docs repository to get the latest data. This fetches and resets to the latest version from GitHub. The server automatically checks for updates every 24 hours by default, but you can use this tool to update immediately. After updating, you may need to restart the MCP server or rebuild the index to see changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/update_repository.ts:8-19 (handler)The main tool handler: defines the 'update_repository' tool with schema, description, and execute function that invokes forceUpdateRepo() to perform the repository update.export const updateRepositoryTool: ToolDefinition< typeof schema, ReturnType<typeof forceUpdateRepo> > = { name: "update_repository", description: "Force update the cached FedRAMP docs repository to get the latest data. This fetches and resets to the latest version from GitHub. The server automatically checks for updates every 24 hours by default, but you can use this tool to update immediately. After updating, you may need to restart the MCP server or rebuild the index to see changes.", schema, execute: async () => { return await forceUpdateRepo(); }, };
- src/tools/update_repository.ts:6-6 (schema)Zod schema for the tool input (empty object as it takes no parameters).const schema = z.object({});
- src/tools/register.ts:24-53 (registration)Registers the updateRepositoryTool among other tools by passing it to registerToolDefs on the MCP server.export function registerTools(server: McpServer): void { registerToolDefs(server, [ // Document discovery listFrmrDocumentsTool, getFrmrDocumentTool, listVersionsTool, // KSI tools listKsiTool, getKsiTool, filterByImpactTool, getThemeSummaryTool, getEvidenceExamplesTool, // Control mapping tools listControlsTool, getControlRequirementsTool, analyzeControlCoverageTool, // Search & lookup tools searchMarkdownTool, readMarkdownTool, searchDefinitionsTool, getRequirementByIdTool, // Analysis tools diffFrmrTool, grepControlsTool, significantChangeTool, // System tools healthCheckTool, updateRepositoryTool, ]); }
- src/repo.ts:158-175 (helper)Core helper function that performs the forced repository update by fetching from remote and resetting, returning success status and message.export async function forceUpdateRepo(): Promise<{ success: boolean; message: string; }> { try { const repoPath = getRepoPath(); await updateRepo(repoPath); return { success: true, message: `Successfully updated repository at ${repoPath}`, }; } catch (error) { return { success: false, message: `Failed to update repository: ${(error as Error).message}`, }; } }
- src/repo.ts:118-132 (helper)Low-level helper that executes git fetch and hard reset to origin/main for repository update.async function updateRepo(repoPath: string): Promise<void> { try { const git = simpleGit(repoPath); await git.fetch(["origin"]); await git.reset(["--hard", "origin/main"]); console.error( `fedramp-docs-mcp: Updated repository at ${repoPath}`, ); } catch (error) { console.error( `fedramp-docs-mcp: Failed to update repository: ${(error as Error).message}`, ); // Don't throw - continue with existing cache } }