Skip to main content
Glama
kitan23

Dedalus MCP Documentation Server

by kitan23

list_docs

Browse available documentation files to locate specific resources or explore content structure within the Dedalus MCP Documentation Server.

Instructions

List all available documentation files

Args:
    directory: Optional subdirectory to list (relative to docs root)

Returns:
    List of document metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'list_docs' tool. It lists all markdown documentation files recursively from the specified directory (defaulting to DOCS_DIR), retrieves metadata for each, and returns a sorted list.
    @mcp.tool()
    def list_docs(directory: Optional[str] = None) -> List[Dict[str, Any]]:
        """
        List all available documentation files
    
        Args:
            directory: Optional subdirectory to list (relative to docs root)
    
        Returns:
            List of document metadata
        """
        search_dir = DOCS_DIR
        if directory:
            search_dir = DOCS_DIR / directory
    
        if not search_dir.exists():
            return []
    
        docs = []
        for file_path in search_dir.rglob('*.md'):
            if file_path.is_file():
                docs.append(get_doc_metadata(file_path))
    
        return sorted(docs, key=lambda x: x['path'])
  • Helper utility function used by list_docs to extract metadata (title, path, modified date, size, hash) from each documentation file, with caching.
    def get_doc_metadata(file_path: Path) -> Dict[str, Any]:
        """Extract metadata from markdown files"""
        if file_path in METADATA_CACHE:
            return METADATA_CACHE[file_path]
    
        metadata = {
            'title': file_path.stem.replace('-', ' ').title(),
            'path': str(file_path.relative_to(DOCS_DIR)),
            'modified': datetime.fromtimestamp(file_path.stat().st_mtime).isoformat(),
            'size': file_path.stat().st_size,
            'hash': hashlib.md5(file_path.read_bytes()).hexdigest(),
        }
    
        # Try to extract title from first # heading
        try:
            content = file_path.read_text()
            lines = content.split('\n')
            for line in lines[:10]:  # Check first 10 lines
                if line.startswith('# '):
                    metadata['title'] = line[2:].strip()
                    break
        except (OSError, UnicodeDecodeError):
            pass
    
        METADATA_CACHE[file_path] = metadata
        return metadata
  • src/main.py:178-178 (registration)
    The @mcp.tool() decorator that registers the list_docs function as an MCP tool.
    @mcp.tool()
  • Docstring providing schema description: input parameter 'directory' (optional str), output List[Dict[str, Any]] of document metadata.
    """
    List all available documentation files
    
    Args:
        directory: Optional subdirectory to list (relative to docs root)
    
    Returns:
        List of document metadata
    """
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. It mentions returning 'List of document metadata' but doesn't disclose behavioral traits like pagination, rate limits, authentication needs, or what 'metadata' includes. For a tool with no annotations, this leaves significant gaps in understanding its operation.

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 highly concise and well-structured: a clear purpose statement, followed by 'Args' and 'Returns' sections with brief explanations. Every sentence earns its place, and it's front-loaded with the main functionality. No wasted words or redundancy.

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) and the presence of an output schema (which handles return values), the description is somewhat complete. However, with no annotations and minimal behavioral disclosure, it lacks depth for safe and effective use. It's adequate but has clear gaps in guidance and transparency.

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: it explains that 'directory' is an 'Optional subdirectory to list (relative to docs root)', which clarifies its purpose beyond the schema's basic title. With 0% schema description coverage and only one parameter, this compensation is effective, though not exhaustive.

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 available documentation files' specifies the verb (list) and resource (documentation files). It distinguishes from siblings like 'search_docs' (searching) and 'analyze_docs' (analysis), though it doesn't explicitly mention these distinctions. The purpose is specific but could be more precise about scope.

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 'search_docs' or 'index_docs'. The description implies it lists all files, but it doesn't specify use cases, prerequisites, or exclusions. Without such context, an agent might misuse it when a more targeted tool is needed.

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/kitan23/Python_MCP_Server_Example_2'

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