Skip to main content
Glama

list_models

Discover exported Pydantic models in configured Python packages. Use this tool to find available models for validation, schema generation, or migration analysis.

Instructions

Discover exported Pydantic models in configured packages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packagesNo
filterNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultNo
artifactsNo
diagnosticsNo
resolved_targetNo

Implementation Reference

  • The implementation of the `list_models` tool, which discovers Pydantic models in specified packages and returns them as a `ToolResponse`.
    @mcp.tool(tags={"discovery", "pydantic"})
    def list_models(
        packages: list[str] | None = None,
        filter: str | None = None,
    ) -> ToolResponse:
        """Discover exported Pydantic models in configured packages."""
        package_list = packages or SERVER_SETTINGS.default_scan_packages
        entries = REGISTRY.discover(package_list)
        models = registry_entries_to_summaries(entries, pattern=filter)
        return make_response(
            diagnostics=[
                Diagnostic(
                    level="info",
                    message=f"Discovered {len(models)} model(s).",
                    code="model_discovery",
                )
            ],
            artifacts={"packages": package_list},
            result={"models": [model.model_dump(mode="json") for model in models]},
        )
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 for behavioral disclosure. It mentions 'configured packages' which hints at some setup dependency, but doesn't explain what 'exported' means, whether this requires specific permissions, what format the output takes, or any limitations like pagination or rate limits.

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 a single, efficient sentence that gets straight to the point without any wasted words. It's appropriately sized for a tool with two parameters and an output schema.

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 has an output schema (which handles return values) and only two parameters, the description is minimally adequate. However, with 0% schema description coverage and no annotations, it leaves significant gaps in understanding parameter usage and behavioral context that could be addressed.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'configured packages' which loosely relates to the 'packages' parameter, but doesn't explain the 'filter' parameter at all or provide any details about parameter formats, constraints, or usage 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 action ('Discover') and resource ('exported Pydantic models in configured packages'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'explain_model' or 'inspect_type', which might also involve model discovery or inspection.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'explain_model' and 'inspect_type' that might overlap in functionality, there's no indication of when this listing tool is preferred over those more specific tools.

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/BitingSnakes/pydantic-mcp'

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