Skip to main content
Glama

list_pdfs

Find PDF files across directories with optional filtering to locate specific documents quickly.

Instructions

List PDF files in configured base paths

Args:
    path_filter: Optional string to filter PDF paths

Returns:
    List of PDF paths matching the filter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
path_filterNo

Implementation Reference

  • The main handler function for the 'list_pdfs' tool. It walks through configured base directories (BASE_PATHS), finds all PDF files, applies an optional path_filter, and returns a sorted list of matching PDF paths.
    @mcp.tool()
    def list_pdfs(path_filter: Optional[str] = None) -> List[str]:
        """
        List PDF files in configured base paths
    
        Args:
            path_filter: Optional string to filter PDF paths
    
        Returns:
            List of PDF paths matching the filter
        """
        results = []
    
        for base_path in BASE_PATHS:
            base = Path(base_path)
            if not base.exists():
                continue
    
            for root, _, files in os.walk(base):
                root_path = Path(root)
                for file in files:
                    if file.lower().endswith(".pdf"):
                        pdf_path = root_path / file
                        path_str = str(pdf_path)
    
                        # Apply filter if provided
                        if path_filter and path_filter not in path_str:
                            continue
    
                        results.append(path_str)
    
        return sorted(results)
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 mentions 'configured base paths' which hints at setup requirements, but doesn't describe what happens if no paths are configured, whether the operation is read-only (implied by 'List'), error conditions, or return format details beyond 'List of PDF paths'. For a tool with zero annotation coverage, this leaves significant behavioral 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 extremely concise and well-structured: a clear purpose statement followed by dedicated 'Args' and 'Returns' sections. Every sentence earns its place, with no redundant information. The formatting enhances readability for an AI agent.

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 low complexity (one optional parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose, parameter meaning, and return type. However, it lacks important context like error handling, what 'configured base paths' means, or whether the list is paginated/limited. For a simple list operation, this is borderline complete.

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 for the single parameter: 'Optional string to filter PDF paths' explains what 'path_filter' does beyond the schema's title 'Path Filter'. With 0% schema description coverage, this compensates well by clarifying the parameter's purpose and optionality. However, it doesn't specify filter syntax or examples.

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 PDF files in configured base paths' - a specific verb ('List') and resource ('PDF files') with scope ('in configured base paths'). It distinguishes from siblings like 'extract_text' or 'render_pdf_page' by focusing on listing rather than content extraction or rendering. However, it doesn't explicitly differentiate from potential sibling list operations (though none exist in this server).

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. The description doesn't mention prerequisites (e.g., needing configured base paths), when this tool is appropriate versus other PDF operations, or any limitations. The agent must infer usage from the purpose alone.

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/Wildebeest/mcp_pdf_forms'

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