get_chapter_summary
Extract key insights from specific book chapters by providing book ID and chapter number to access AI-generated summaries.
Instructions
Get the summary for a specific chapter of a book
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"book_id": "<book_id>",
"chapter_number": "<chapter_number>"
},
"name": "get_chapter_summary"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| book_id | Yes | ||
| chapter_number | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- libralm_mcp_server.py:190-200 (handler)The handler function for the 'get_chapter_summary' tool. It is registered via the @mcp.tool() decorator and implements the logic to fetch a chapter summary from the LibraLM API using the _make_api_request helper.
@mcp.tool() def get_chapter_summary(book_id: str, chapter_number: int) -> str: """Get the summary for a specific chapter of a book""" try: data = _make_api_request(f"/books/{book_id}/chapters/{chapter_number}") return data.get("summary", "") except Exception as e: raise ValueError( f"Error getting chapter {chapter_number} summary for book '{book_id}': {str(e)}" )