Skip to main content
Glama

edit_summary

Modify summary text for specific nodes in HNPX documents to update narrative content during collaborative fiction writing.

Instructions

Edit summary text of a node

Args: file_path (str): Path to the HNPX document node_id (str): ID of the node containing the summary new_summary (str): New summary text content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
node_idYes
new_summaryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function that implements the edit_summary tool. It parses the HNPX document, locates the specified node, validates it (not a paragraph), updates or creates the summary element with new text, saves the document, and returns a confirmation message.
    def edit_summary(file_path: str, node_id: str, new_summary: str) -> str:
        """Edit summary text of a node
    
        Args:
            file_path (str): Path to the HNPX document
            node_id (str): ID of the node containing the summary
            new_summary (str): New summary text content
        """
        tree = hnpx.parse_document(file_path)
        node = hnpx.find_node(tree, node_id)
    
        if node is None:
            raise NodeNotFoundError(node_id)
    
        if node.tag == "paragraph":
            raise InvalidOperationError(
                "edit_summary", "Paragraphs can't contain summaries"
            )
    
        # Find the summary child element
        summary_elem = node.find("summary")
        if summary_elem is None:
            # Create summary if it doesn't exist (shouldn't happen with valid HNPX)
            summary_elem = etree.SubElement(node, "summary")
    
        # Update the summary text
        summary_elem.text = new_summary
    
        hnpx.save_document(tree, file_path)
    
        return f"Updated summary for node {node_id}"
  • The line where the edit_summary tool is registered with the FastMCP application using the app.tool() decorator.
    app.tool()(tools.edit_summary)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action is to 'Edit,' implying a mutation operation, but fails to describe critical behaviors such as permission requirements, whether the edit is reversible, error handling, or side effects. This is a significant gap for a mutation tool with zero annotation coverage.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, with the core purpose stated first in a concise sentence, followed by parameter details. There is no wasted text, and the structure is clear, though the parameter descriptions could be more informative without sacrificing brevity.

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

Completeness3/5

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

Given the tool's complexity as a mutation operation with no annotations, 3 parameters, and an output schema present, the description is partially complete. It covers the basic purpose and parameters but lacks behavioral details and usage guidelines. The output schema mitigates the need to explain return values, but overall completeness is moderate with clear gaps.

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

Parameters3/5

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

The description includes an 'Args' section that lists and briefly describes each parameter, adding meaning beyond the input schema, which has 0% description coverage. However, the descriptions are minimal (e.g., 'Path to the HNPX document') and do not provide detailed semantics like format constraints or examples, offering only basic compensation for the schema gap.

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 action ('Edit') and target ('summary text of a node'), making the purpose evident. However, it does not explicitly differentiate this tool from similar siblings like 'edit_node_attributes' or 'edit_paragraph_text', which might also modify node content or properties, leaving some ambiguity in sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'edit_node_attributes' and 'edit_paragraph_text' available, there is no indication of specific contexts, prerequisites, or exclusions for choosing 'edit_summary' over other editing tools, leaving usage unclear.

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

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