Skip to main content
Glama

form_add_validation

Add client-side validation rules to any form using schema constraints. Choose Zod, Yup, Joi, or native validation to enforce required fields, min/max, and patterns.

Instructions

Add client-side validation rules to a form based on schema constraints

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaNoSchema with validation constraints (min, max, pattern, required)
api_keyNoAPI key for authentication
libraryNoValidation library: 'zod', 'yup', 'joi', 'native'
form_codeYesExisting form code to add validation to
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 behavioral burden. It says 'Add...to a form', implying mutation, but does not disclose whether existing validation rules are overwritten, whether source files are modified, whether authentication is required, or any failure/idempotency behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single efficient sentence that is front-loaded with the action and object. It contains no filler and earns its place, though it leaves room for behavioral or usage details that would improve completeness.

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?

For a mutation tool with no annotations and no output schema, this description is too thin. It does not explain the expected effect on existing form code, the role of form_code, or how this tool relates to sibling validation/generation tools. The schema covers parameter meaning, but contextual and selection guidance is missing.

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?

The input schema documents all four parameters (schema, api_key, library, form_code) with descriptions, so the baseline is 3. The description adds only 'based on schema constraints,' which loosely references the schema parameter but provides no additional format, syntax, or default behavior beyond the schema.

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 identifies a specific action ('Add client-side validation rules') and a resource ('a form based on schema constraints'), making the tool's purpose clear. It distinguishes itself from general form generation tools by focusing on validation for existing forms, though it does not explicitly name sibling alternatives.

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 intended use is implied: use this when you need client-side validation derived from schema constraints. However, there is no explicit guidance on when to prefer this over siblings like form_generate_component or mapper_add_validation, and no exclusions or alternative conditions are mentioned.

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/barnburner121/claude-plugin-marketplace'

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