Skip to main content
Glama

get_root_id

Retrieve the root node ID from HNPX XML documents to enable structured fiction writing and hierarchical narrative development.

Instructions

Get ID of the book node (document root)

Args: file_path (str): Path to the HNPX document

Returns: str: ID of the book node

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes

Implementation Reference

  • The main handler function for the get_root_id tool. It parses the HNPX XML document from the given file_path and returns the 'id' attribute of the root 'book' element.
    def get_root_id(file_path: str) -> str: """Get ID of the book node (document root) Args: file_path (str): Path to the HNPX document Returns: str: ID of the book node """ tree = hnpx.parse_document(file_path) root = tree.getroot() return root.get("id")
  • Registers the get_root_id function as an MCP tool using FastMCP's app.tool() decorator.
    app.tool()(tools.get_root_id)

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/mozhaa/hnpx-sdk'

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