Skip to main content
Glama
7robots

Micro.blog Books MCP Server

by 7robots

update_reading_goal

Modify an existing reading goal by adjusting the target number of books and optionally updating current progress to track reading achievements.

Instructions

Update reading goal.

Args: goal_id: The ID of the reading goal value: The target number of books for the goal progress: The current progress (number of books read, optional)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
goal_idYes
valueYes
progressNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core handler logic in MicroBooksClient that performs HTTP POST to `/books/goals/${goalId}` with value and optional progress parameters to update the reading goal on Micro.blog.
    async updateReadingGoal(goalId, value, progress = null) {
      if (!Number.isInteger(goalId) || goalId <= 0) {
        throw new Error("Goal ID must be a positive integer");
      }
      if (!Number.isInteger(value) || value <= 0) {
        throw new Error("Goal value must be a positive integer");
      }
    
      const data = { value: value.toString() };
      if (progress !== null) {
        if (!Number.isInteger(progress) || progress < 0) {
          throw new Error("Progress must be a non-negative integer");
        }
        data.progress = progress.toString();
      }
    
      await this.makeRequest(`/books/goals/${goalId}`, {
        method: "POST",
        body: new URLSearchParams(data),
      });
    
      return { success: true, message: "Reading goal updated successfully" };
    }
  • Tool registration including name, description, and input schema for 'update_reading_goal'.
      {
        name: "update_reading_goal",
        description: "Update a reading goal's target or progress",
        inputSchema: {
          type: "object",
          properties: {
            goal_id: {
              type: "integer",
              description: "The ID of the reading goal",
              minimum: 1,
            },
            value: {
              type: "integer",
              description: "The target number of books for the goal",
              minimum: 1,
            },
            progress: {
              type: "integer",
              description: "The current progress (number of books read, optional)",
              minimum: 0,
            },
          },
          required: ["goal_id", "value"],
        },
      },
    ];
  • Dispatch handler in MCP server that calls the client method for update_reading_goal tool.
    case "update_reading_goal": {
      const { goal_id, value, progress } = args;
      const result = await client.updateReadingGoal(goal_id, value, progress);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • MCP tool handler decorated with @mcp.tool() that executes the update_reading_goal logic by calling the client.
    async def update_reading_goal(goal_id: int, value: int, progress: Optional[int] = None) -> str:
        """Update reading goal.
        
        Args:
            goal_id: The ID of the reading goal
            value: The target number of books for the goal
            progress: The current progress (number of books read, optional)
        """
        try:
            result = await client.update_reading_goal(goal_id, value, progress)
            return json.dumps(result, indent=2)
        except Exception:
            logger.exception("Failed to update reading goal")
            raise
  • Supporting client method that performs the actual HTTP request to update the reading goal.
    async def update_reading_goal(self, goal_id: int, value: int, progress: Optional[int] = None) -> dict:
        """Update reading goal."""
        data = {"value": str(value)}
        if progress is not None:
            data["progress"] = str(progress)
    
        async with httpx.AsyncClient() as client:
            response = await client.post(
                urljoin(BASE_URL, f"/books/goals/{goal_id}"),
                headers=self.headers,
                data=data,
            )
            response.raise_for_status()
            return {"success": True, "message": "Reading goal updated successfully"}
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'Update' which implies mutation, but doesn't mention permissions needed, whether changes are reversible, error conditions, or what the response contains. The description lacks critical behavioral context for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately brief but could be more front-loaded. The first line 'Update reading goal.' is clear but sparse, and the parameter documentation is well-structured but could be integrated more seamlessly. No wasted words, but room for improvement in flow.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), 3 parameters with good semantic coverage in the description, and moderate complexity, the description is reasonably complete. The main gap is lack of behavioral context for this mutation operation, but the parameter documentation is strong.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides clear semantic meaning for all three parameters beyond what the schema offers (0% coverage). It explains that 'goal_id' identifies the goal, 'value' is the target number of books, and 'progress' is current books read (with optional status). This compensates well for the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Update') and resource ('reading goal'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential sibling tools like 'get_reading_goals' or 'get_goal_progress' beyond the update action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. There's no mention of prerequisites (e.g., needing an existing goal), exclusions, or how this relates to sibling tools like 'get_reading_goals' or 'get_goal_progress'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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