Skip to main content
Glama

constraint_validate

Read-only

Validate values against LMQL-style constraints like YQ_PATH, JSON_VALUE, or INT to ensure data integrity before processing in JSON/YAML/TOML operations.

Instructions

Validate a value against an LMQL-style constraint.

Use this tool to check if a value satisfies a constraint before using it in other operations. Supports partial validation - can tell if an incomplete input could still become valid.

Output contract: Returns {"valid": bool, "error": str?, "is_partial": bool?, ...}. Side effects: None (read-only validation). Failure modes: ToolError if constraint name unknown.

Available constraints:

  • YQ_PATH: Valid yq path (e.g., '.users[0].name')

  • YQ_EXPRESSION: Valid yq expression with pipes (e.g., '.items | length')

  • CONFIG_FORMAT: Valid format ('json', 'yaml', 'toml', 'xml')

  • KEY_PATH: Dot-separated key path (e.g., 'config.database.host')

  • INT: Valid integer

  • JSON_VALUE: Valid JSON syntax

  • FILE_PATH: Valid file path syntax

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
constraint_nameYesName of the constraint to validate against (e.g., 'YQ_PATH', 'CONFIG_FORMAT', 'INT')
valueYesValue to validate

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations provide readOnlyHint=true, and the description adds valuable behavioral context beyond this: it specifies 'Side effects: None (read-only validation)', 'Failure modes: ToolError if constraint name unknown', and details about partial validation support. This enhances transparency without contradicting annotations.

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 well-structured and front-loaded with the core purpose, followed by usage guidelines, output contract, side effects, failure modes, and constraint list. Every sentence adds value without redundancy, 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.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (validation with partial support), rich annotations (readOnlyHint), 100% schema coverage, and the presence of an output schema (implied by 'Output contract'), the description is complete. It covers purpose, usage, behavior, and constraints, leaving no significant gaps for the agent.

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 100%, so the schema already documents both parameters fully. The description adds some context by listing available constraints (e.g., YQ_PATH, INT) and examples, but this doesn't significantly enhance parameter meaning beyond what the schema provides, warranting the baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('validate a value against an LMQL-style constraint') and resource ('value'), distinguishing it from siblings like constraint_list (which lists constraints) or data_query (which queries data). It explicitly mentions what the tool does rather than restating the name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool ('check if a value satisfies a constraint before using it in other operations') and includes a partial validation use case. It distinguishes from alternatives by focusing on constraint validation rather than data operations like data_convert or data_merge.

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/bitflight-devops/mcp-json-yaml-toml'

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