Skip to main content
Glama
omniwaifu

Pydantic AI Documentation Server

by omniwaifu

list_topics

Browse Pydantic AI documentation topics and files to locate specific content. Use this tool to navigate the documentation structure and find relevant information.

Instructions

Lists files and directories non-recursively within the Pydantic documentation. The path is relative to the 'docs/' directory in the cloned Pydantic repository.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo

Implementation Reference

  • The handler implementation for the `list_topics` tool, which lists files and directories in the Pydantic docs repository.
    @app.tool()
    async def list_topics(path: Optional[str] = None) -> List[TopicItem]:
        """
        Lists files and directories non-recursively within the Pydantic documentation.
        The path is relative to the 'docs/' directory in the cloned Pydantic repository.
        """
        logger.info(f"Listing topics for path: {path if path else 'root'}")
    
        try:
            repo_root = get_repo_path()
            docs_root = repo_root / "docs"
    
            if not docs_root.exists() or not docs_root.is_dir():
                logger.error(f"Pydantic docs directory not found at {docs_root}")
                return []
    
            current_path = docs_root
            if path:
                target_path = (docs_root / path).resolve(strict=False)
    
                if not str(target_path).startswith(str(docs_root.resolve())):
                    logger.warning(f"Path traversal attempt or invalid path: {path}")
                    return []
    
                if not target_path.exists() or not target_path.is_dir():
                    logger.info(
                        f"Specified path does not exist or is not a directory: {target_path}"
                    )
                    return []
                current_path = target_path
    
            items: List[TopicItem] = []
            for item in current_path.iterdir():
                if item.name.startswith("."):
                    continue
    
                item_relative_path = item.relative_to(docs_root).as_posix()
    
                items.append(
                    TopicItem(
                        name=item.name, path=item_relative_path, is_directory=item.is_dir()
                    )
                )
    
            items.sort(key=lambda x: (not x.is_directory, x.name.lower()))
    
            return items
Behavior2/5

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

No annotations are provided, so the description carries full burden. It discloses the tool's scope ('non-recursively') and path context, but lacks critical behavioral details such as return format (e.g., list of strings, objects with metadata), pagination, error handling, or authentication requirements. For a tool with no annotation coverage, this 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 extremely concise with two sentences that directly convey essential information: the action, scope, and path context. Every word serves a purpose, and it's front-loaded with the core functionality, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/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 low schema coverage, the description is incomplete. It covers basic purpose and parameter context but omits critical details like return values, error conditions, and behavioral constraints. For a tool that likely returns a list of items, the lack of output information is a significant gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description adds meaningful context for the single parameter: it explains that 'path' is relative to 'docs/' directory and clarifies the tool's scope. However, it doesn't detail parameter format (e.g., string patterns, null behavior) or provide examples, leaving some ambiguity despite compensating partially for the schema gap.

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 with specific verbs ('Lists files and directories') and resources ('within the Pydantic documentation'), and specifies the scope ('non-recursively'). It distinguishes from potential recursive listing tools but doesn't explicitly differentiate from sibling tools like 'list_available_changelogs' or 'get_document_by_path'.

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 implies usage context by specifying 'non-recursively' and the path's relation to 'docs/' directory, suggesting this is for browsing documentation structure. However, it provides no explicit guidance on when to use this tool versus alternatives like 'get_document_by_path' or 'list_available_changelogs', nor does it mention prerequisites or exclusions.

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/omniwaifu/pydantic-ai-docs-server'

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