Skip to main content
Glama

validate_data

Validate input data against Pydantic models or Python type expressions to ensure data integrity and type safety.

Instructions

Validate input against a model name or Python type expression.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYes
dataYes
modeNopython
strictNo
contextNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultNo
artifactsNo
diagnosticsNo
resolved_targetNo

Implementation Reference

  • The core implementation of the `validate_data` tool, which handles the validation logic by resolving the target and calling `validate_with_adapter`.
    def validate_data(
        target: str,
        data: object,
        mode: str = "python",
        strict: bool = False,
        context: dict[str, object] | None = None,
    ) -> ToolResponse:
        """Validate input against a model name or Python type expression."""
        runtime_target = resolve_target(
            target,
            registry=REGISTRY,
            settings=SERVER_SETTINGS,
        )
        response = validate_with_adapter(
            runtime_target,
            data=data,
            mode=mode,
            strict=strict,
            context=context,
        )
        _record_response_errors("validate_data", target, response)
        return response
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool validates input but doesn't explain what happens during validation (e.g., returns validation results, errors, or success status), how it handles invalid data, or any performance or security considerations. This is inadequate for a tool with 5 parameters and an output schema.

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 with no wasted words. It's appropriately sized and front-loaded, clearly stating the core purpose without unnecessary elaboration.

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 5 parameters with 0% schema coverage and an output schema exists, the description is incomplete. It doesn't explain parameter semantics or behavioral traits, though the output schema may cover return values. For a validation tool with multiple parameters, more context is needed to guide effective use.

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?

The schema description coverage is 0%, so the description must compensate by explaining parameters. It mentions 'model name or Python type expression' (hinting at the 'target' parameter) and 'input' (hinting at 'data'), but doesn't cover 'mode', 'strict', or 'context', nor does it clarify the meaning or usage of any parameters beyond vague hints.

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: 'Validate input against a model name or Python type expression.' It specifies the verb (validate) and the resource (input), though it doesn't explicitly differentiate from sibling tools like 'compare_validation_modes' or 'inspect_type'.

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. It doesn't mention sibling tools like 'compare_validation_modes' for comparing validation methods or 'inspect_type' for type inspection, leaving the agent with no context for tool selection.

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