get-difficulty-adjustment
Retrieve Bitcoin difficulty adjustment data to understand network mining complexity changes and predict future adjustments.
Instructions
Returns current and next Bitcoin difficulty adjustment info
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- MCP tool handler function for 'get-difficulty-adjustment'. Fetches data from GeneralService and returns it as text content in MCP format.async () => { const text = await this.generalService.getDifficultyAdjustment(); return { content: [{ type: "text", text }] }; }
- src/interface/controllers/GeneralToolsController.ts:18-25 (registration)Registers the 'get-difficulty-adjustment' tool with the MCP server, including name, description, and handler function.this.server.tool( "get-difficulty-adjustment", "Returns current and next Bitcoin difficulty adjustment info", async () => { const text = await this.generalService.getDifficultyAdjustment(); return { content: [{ type: "text", text }] }; } );
- Helper method in GeneralService that retrieves raw data from RequestService and formats it into a string response.async getDifficultyAdjustment(): Promise<string> { const data = await this.requestService.getDifficultyAdjustment(); return formatResponse<any>("Difficulty Adjustment", data); }
- Core helper method that makes an API request to fetch the difficulty adjustment data.async getDifficultyAdjustment(): Promise<any | null> { return this.client.makeRequest<any>(`difficulty-adjustment`); }