Skip to main content
Glama

set_list_level

Adjust list indentation levels in Word documents to organize content hierarchy. Specify paragraph index and desired level (0-8) for structured formatting.

Instructions

Set indentation level for a list paragraph.

Args: filepath: Path to the document paragraph_index: Index of the paragraph level: Indentation level (0-8)

Returns: Dictionary with status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filepathYes
paragraph_indexYes
levelYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the set_list_level tool handler.
    @app.tool()
    def set_list_level(filepath: str, paragraph_index: int, level: int) -> dict[str, Any]:
        """
        Set indentation level for a list paragraph.
    
        Args:
            filepath: Path to the document
            paragraph_index: Index of the paragraph
            level: Indentation level (0-8)
    
        Returns:
            Dictionary with status
        """
        logger.info("Setting list level", extra={"tool": "set_list_level", "filepath": filepath})
    
        try:
            if level < 0 or level > 8:
                raise InvalidParameterError("level", "Level must be between 0 and 8")
    
            doc = safe_open_document(filepath)
    
            if paragraph_index < 0 or paragraph_index >= len(doc.paragraphs):
                raise InvalidParameterError("paragraph_index", "Index out of range")
    
            paragraph = doc.paragraphs[paragraph_index]
            paragraph.paragraph_format.left_indent = Inches(0.5 * level)
    
            safe_save_document(doc, filepath)
            logger.info(f"Set list level to {level} for paragraph", extra={"filepath": filepath})
    
            return {
                "status": "success",
                "filepath": filepath,
                "paragraph_index": paragraph_index,
                "level": level,
            }
        except DocxMcpError as e:
            logger.warning(e.message, extra={"tool": "set_list_level", "error_code": e.error_code})
            return {"status": "error", "error": e.message, "error_code": e.error_code}
        except Exception as e:
            logger.error(f"Unexpected error setting list level: {str(e)}")
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It mentions a return type ('Dictionary with status') but doesn't specify what the status indicates, whether the operation is destructive, requires specific permissions, or has side effects. This is inadequate 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 front-loaded with the core purpose, followed by brief parameter and return explanations. It's efficient with minimal waste, though the 'Args:' and 'Returns:' sections could be integrated more smoothly into the flow.

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 has an output schema (which handles return values), no annotations, and low schema coverage, the description is partially complete. It covers the basic purpose and parameter semantics but lacks usage guidelines and sufficient behavioral transparency, making it adequate but with clear gaps.

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 adds meaningful context beyond the schema: it explains that 'level' is an 'Indentation level (0-8)', which clarifies its range and purpose. Since schema description coverage is 0%, this compensates well, though it doesn't detail all parameters (e.g., filepath format or paragraph_index specifics).

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 ('Set indentation level') and target ('for a list paragraph'), which is specific and distinguishes it from siblings like apply_bullet_list or apply_paragraph_style. However, it doesn't explicitly differentiate from all siblings (e.g., set_document_properties might also affect formatting), so it's not a perfect 5.

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 on when to use this tool versus alternatives like apply_bullet_list or apply_paragraph_style, nor any prerequisites or context for its use. The description only states what it does, not when or why to choose it.

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/Andrew82106/LLM_Docx_Agent_MCP'

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