Skip to main content
Glama

inspect_type

Resolve Python type annotations or Pydantic models into structured descriptions to understand data structures and validation rules.

Instructions

Resolve a Python type annotation or model into a structured description.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYes
expand_nestedNo

Implementation Reference

  • The handler function for the `inspect_type` MCP tool, which resolves a type target and returns a structured description.
    @mcp.tool(tags={"inspect", "pydantic"})
    def inspect_type(
        target: str,
        expand_nested: bool = True,
    ) -> ToolResponse:
        """Resolve a Python type annotation or model into a structured description."""
        runtime_target = resolve_target(
            target,
            registry=REGISTRY,
            settings=SERVER_SETTINGS,
        )
        return make_response(
            resolved_target=runtime_target.resolved,
            result={
                "type": describe_type(
                    runtime_target.annotation,
                    expand_nested=expand_nested,
                ).model_dump(mode="json")
            },
        )

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