Skip to main content
Glama

list_conversions

Find previously converted Office documents by viewing cached conversion records with output paths and extracted image counts.

Instructions

List all cached document conversions.

Shows all documents that have been converted, including their output paths and number of extracted images. Useful for finding previously converted files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tool handler for 'list_conversions' which retrieves cache information from the converter and formats a detailed textual summary including total counts, file listings, and raw JSON data.
    elif name == "list_conversions":
        cache_info = converter.get_cache_info()
    
        # Build a formatted summary
        summary_lines = [
            "=" * 50,
            "       OfficeReader-MCP Cache Information",
            "=" * 50,
            "",
            cache_notice,
            f"Output directory: {cache_info.get('output_dir', 'N/A')}",
            "",
            f"Total cached conversions: {cache_info['total_conversions']}",
            f"Total cache size: {cache_info.get('total_size_human', 'N/A')}",
            "",
        ]
    
        if cache_info['conversions']:
            summary_lines.append("-" * 50)
            summary_lines.append("       Cached Documents")
            summary_lines.append("-" * 50)
    
            for i, conv in enumerate(cache_info['conversions'], 1):
                summary_lines.append(f"\n[{i}] {conv['name']}")
                summary_lines.append(f"    Directory: {conv['path']}")
                if conv['markdown_files']:
                    summary_lines.append(f"    Markdown:  {conv['markdown_files'][0]}")
                summary_lines.append(f"    Images:    {conv['image_count']} files")
                summary_lines.append(f"    Size:      {conv.get('size_human', 'N/A')}")
                if conv.get('modified'):
                    summary_lines.append(f"    Modified:  {conv['modified']}")
        else:
            summary_lines.append("-" * 50)
            summary_lines.append("No cached conversions found.")
            summary_lines.append("")
            summary_lines.append("To convert a document, use the 'convert_document' tool:")
            summary_lines.append("  file_path: <path to your .docx or .doc file>")
    
        summary_lines.append("")
        summary_lines.append("=" * 50)
        summary_lines.append("\n--- Raw JSON Data ---")
    
        return [TextContent(
            type="text",
            text="\n".join(summary_lines) + "\n" + json.dumps(cache_info, ensure_ascii=False, indent=2)
        )]
  • Registration of the 'list_conversions' tool in the list_tools handler, including its description and empty input schema.
            Tool(
                name="list_conversions",
                description="""List all cached document conversions.
    
    Shows all documents that have been converted, including their output paths
    and number of extracted images. Useful for finding previously converted files.""",
                inputSchema={
                    "type": "object",
                    "properties": {},
                },
            ),
            Tool(
  • Core helper method in DocxConverter that scans the cache output directory, lists conversion subdirectories, computes sizes and metadata for markdown files and images, and returns structured cache information. OfficeConverter proxies this method.
    def get_cache_info(self) -> dict:
        """Get information about cached conversions."""
        conversions = []
        total_size = 0
    
        if not self.output_dir.exists():
            return {
                "cache_dir": str(self.cache_dir),
                "output_dir": str(self.output_dir),
                "conversions": [],
                "total_conversions": 0,
                "total_size_bytes": 0,
                "total_size_human": "0 B",
            }
    
        for item in self.output_dir.iterdir():
            if item.is_dir():
                md_files = list(item.glob("*.md"))
                images_dir = item / "images"
                images = list(images_dir.glob("*")) if images_dir.exists() else []
    
                # Calculate sizes
                md_size = sum(f.stat().st_size for f in md_files if f.exists())
                img_size = sum(f.stat().st_size for f in images if f.exists())
                dir_size = md_size + img_size
                total_size += dir_size
    
                # Get modification time
                mod_time = ""
                if md_files:
                    mod_time = datetime.fromtimestamp(md_files[0].stat().st_mtime).isoformat()
    
                conversions.append({
                    "name": item.name,
                    "path": str(item),
                    "markdown_files": [str(f) for f in md_files],
                    "image_count": len(images),
                    "image_paths": [str(f) for f in images],
                    "size_bytes": dir_size,
                    "size_human": self._human_readable_size(dir_size),
                    "modified": mod_time,
                })
    
        return {
            "cache_dir": str(self.cache_dir),
            "output_dir": str(self.output_dir),
            "conversions": conversions,
            "total_conversions": len(conversions),
            "total_size_bytes": total_size,
            "total_size_human": self._human_readable_size(total_size),
        }
  • Proxy method in OfficeConverter that delegates cache info retrieval to the underlying DocxConverter instance.
    def get_cache_info(self) -> dict:
        """Get information about cached conversions."""
        return self._docx_converter.get_cache_info()
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool shows 'cached' conversions and lists specific output details, but doesn't address important behavioral aspects like whether results are paginated, sorted, or limited; whether it requires specific permissions; or what happens if the cache is empty. The description provides some context but leaves significant gaps.

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

Conciseness5/5

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

The description is perfectly concise and well-structured: three sentences with zero waste. The first sentence states the core purpose, the second elaborates on what's included, and the third provides usage context. Every sentence earns its place and information is front-loaded.

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 no annotations, no output schema, and 0 parameters, the description provides adequate basic information about what the tool does and when to use it. However, for a tool that presumably returns potentially complex conversion data, the description doesn't explain the return format, structure, or limitations. It's minimally viable but lacks details about what the agent should expect as output.

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 tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, and instead focuses on what the tool returns, which is valuable context for a parameterless tool.

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 tool's purpose: 'List all cached document conversions' with specific details about what information is included (output paths and number of extracted images). It distinguishes from siblings by focusing on cached conversions rather than conversion operations or metadata retrieval, though it doesn't explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance: 'Useful for finding previously converted files' suggests this tool should be used when looking for conversion history rather than performing new conversions. However, it doesn't explicitly state when NOT to use it or name specific alternative tools like 'read_converted_markdown' for accessing converted content.

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/Asunainlove/OfficeReader-MCP'

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