Skip to main content
Glama

get_table_of_contents

Retrieve chapter descriptions and structure for any book in the LibraLM library to quickly understand content organization and key topics.

Instructions

Get the table of contents for a book with chapter descriptions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
book_idYes

Implementation Reference

  • The main handler function for the 'get_table_of_contents' tool. It makes an API request to retrieve the table of contents for a given book_id and returns it as a string. Registered via @mcp.tool() decorator.
    @mcp.tool() def get_table_of_contents(book_id: str) -> str: """Get the table of contents for a book with chapter descriptions""" try: data = _make_api_request(f"/books/{book_id}/table_of_contents") return data.get("table_of_contents", "") except Exception as e: raise ValueError( f"Error getting table of contents for book '{book_id}': {str(e)}" )

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/libralm-ai/libralm_mcp_server'

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