Skip to main content
Glama
marc-hanheide

PDF Redaction MCP Server

list_loaded_pdfs

View all PDF files currently loaded in the PDF Redaction MCP Server to manage document processing workflows.

Instructions

List all currently loaded PDF files.

Returns: List of loaded PDF file paths

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'list_loaded_pdfs' tool. It iterates over the global _loaded_pdfs dictionary to list all loaded PDF paths with their page counts. Decorated with @mcp.tool for automatic registration.
    @mcp.tool async def list_loaded_pdfs(ctx: Context = None) -> str: """List all currently loaded PDF files. Returns: List of loaded PDF file paths """ if not _loaded_pdfs: return "No PDFs currently loaded." loaded_list = "\n".join( f"- {path} ({len(doc)} pages)" for path, doc in _loaded_pdfs.items() ) await ctx.info(f"Currently {len(_loaded_pdfs)} PDF(s) loaded") return f"Currently loaded PDFs:\n{loaded_list}"
  • Global dictionary that stores loaded PDF documents by their file paths. This is the key data structure used by the list_loaded_pdfs handler and other PDF-related tools.
    # Store for loaded PDFs (in-memory, keyed by file path) _loaded_pdfs: dict[str, fitz.Document] = {}
  • The @mcp.tool decorator registers the list_loaded_pdfs function as an MCP tool.
    @mcp.tool

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/marc-hanheide/redact_mcp'

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