Skip to main content
Glama

Validate config

validate_config
Read-onlyIdempotent

Validate a Guard config dict against the installed pydantic model to confirm validity and catch unknown keys that pydantic silently ignores before runtime.

Instructions

Check a Guard config dict against the installed library's real pydantic model.

Use this to confirm a config is valid, or to find out why a setting seems to have no effect. Use config_fields instead when you do not yet know the setting's name.

Returns valid (bool), package, version, model, errors (type errors, each with field, message and input), unknown_fields (each with name and did_you_mean suggestions), deprecated (field and message) and construction_warnings. Unknown keys matter: pydantic silently ignores them, so a misspelled setting does nothing at runtime and raises no error anywhere else. construction_warnings carries guard-core's own logged-not-raised misconfiguration warnings: an unknown constructor keyword, a trusted_proxies or whitelist /0 network, and enabled_detection_categories empty while penetration detection is enabled.

Read-only: the config is validated in memory and never applied. If the library is not installed, or package is not recognized, returns an object with an error key (plus a hint when the cause is a missing install) instead of raising.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
configYesThe config as a JSON object of field names to values, exactly as you would pass it to the model's constructor
packageNoWhich Guard library's installed model to validate against. One of fastapi-guard (SecurityConfig), guard-core (SecurityConfig) or guard-agent (AgentConfig). Any other value returns an error objectfastapi-guard

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive, but the description adds substantial behavior beyond them: validation happens in memory and the config is never applied, pydantic silently ignores unknown keys so misspellings fail silently, construction_warnings enumerates guard-core's logged-not-raised misconfigurations, and non-missing-library errors return an object with an error key instead of raising. This is exactly the kind of runtime context annotations cannot convey.

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?

Front-loaded with the core purpose, then usage, then returns, then error behavior — a sensible order. The one inefficiency is the paragraph enumerating every return field (valid, package, version, model, errors, unknown_fields, deprecated, construction_warnings) when an output schema already exists, which makes it longer than strictly necessary.

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?

For a two-parameter validation tool with nested config input and an output schema, the description covers purpose, routing, safety, silent-failure semantics, and error paths. Nothing an agent needs in order to call it correctly or interpret a surprising result is missing.

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

Parameters4/5

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

Schema coverage is 100%, so both parameters are already documented, which sets a baseline of 3. The description goes further by clarifying what a valid 'config' represents (exactly what you would pass to the model's constructor) and by explaining the failure mode when 'package' is unrecognized, which the schema does not state.

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?

States a specific verb and resource ('Check a Guard config dict against the installed library's real pydantic model') and immediately differentiates itself from the sibling tool config_fields, which it names explicitly. An agent can pick between validate_config and config_fields without opening either schema.

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?

Gives two concrete use cases ('confirm a config is valid' / 'find out why a setting seems to have no effect') and an explicit routing rule to the alternative ('Use config_fields instead when you do not yet know the setting's name'). Nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.