get_goal_progress
Track reading goal completion by retrieving progress data for a specific goal ID.
Instructions
Get books list progress toward a goal.
Args: goal_id: The ID of the reading goal
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal_id | Yes |
Implementation Reference
- dxt-extension/server/index.js:182-187 (handler)Core handler function in MicroBooksClient that implements the get_goal_progress tool logic: validates the goal ID and performs an HTTP GET request to the Micro.blog API endpoint `/books/goals/${goalId}` to retrieve progress data.async getGoalProgress(goalId) { if (!Number.isInteger(goalId) || goalId <= 0) { throw new Error("Goal ID must be a positive integer"); } return await this.makeRequest(`/books/goals/${goalId}`); }
- Tool registration entry including the name 'get_goal_progress' and input schema definition requiring a positive integer 'goal_id'.name: "get_goal_progress", description: "Get progress toward a specific reading goal", inputSchema: { type: "object", properties: { goal_id: { type: "integer", description: "The ID of the reading goal", minimum: 1, }, }, required: ["goal_id"], }, },
- dxt-extension/server/index.js:582-592 (handler)MCP tool dispatch handler case for 'get_goal_progress': extracts goal_id from arguments, calls the client handler, and formats the result as MCP content response.case "get_goal_progress": { const { goal_id } = args; const result = await client.getGoalProgress(goal_id); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], };
- micro_mcp_server/server.py:303-316 (handler)FastMCP tool handler for get_goal_progress: calls the client method and returns JSON string response.@mcp.tool() async def get_goal_progress(goal_id: int) -> str: """Get books list progress toward a goal. Args: goal_id: The ID of the reading goal """ try: result = await client.get_goal_progress(goal_id) return json.dumps(result, indent=2) except Exception: logger.exception("Failed to get goal progress") raise
- modal/modal_http_server.py:133-142 (handler)Supporting client handler method that performs the actual HTTP request to retrieve goal progress.async def get_goal_progress(self, goal_id: int) -> dict: """Get books list progress toward a goal.""" async with httpx.AsyncClient() as client: response = await client.get( urljoin(BASE_URL, f"/books/goals/{goal_id}"), headers=self.headers, ) response.raise_for_status() return response.json()