Skip to main content
Glama
7robots

Micro.blog Books MCP Server

by 7robots

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
NameRequiredDescriptionDefault
goal_idYes

Implementation Reference

  • 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"], }, },
  • 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), }, ], };
  • 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
  • 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()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/7robots/micro-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server