Skip to main content
Glama

get_constraints

List OSCAL Metaschema constraints for a model and target to discover validation rules the JSON schema does not express, including type-specific details and source locations.

Instructions

List the OSCAL Metaschema constraints at a target (allowed-values, matches, index, index-has-key, is-unique, has-cardinality, expect) with type-specific details and source file and line; a bare definition name returns every constraint declared on it and its local definitions. Use when you need rules the JSON schema does not express; use get_allowed_values for the values themselves. Results are paged within a response budget.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum items per page, 1-100. A page may hold fewer to fit the response budget.
modelYesOSCAL model name from list_oscal_models, e.g. "catalog".
offsetNoZero-based index of the first item.
targetYesTarget_Selector: a Metaschema definition name, optionally followed by "/" (child) or "//" (descendant) and instance names, e.g. "defined-component/prop/@name". No predicates, unions, or whitespace.
constraint_typesNoConstraint types to keep. Omit or pass an empty list for all types.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.1

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden: it discloses that a bare definition name expands to every constraint on that definition plus its local definitions, and that results are paged within a response budget. It omits anything about permissions or error behavior, but for a read-only listing tool that gap is minor.

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?

Three front-loaded sentences with the purpose, the routing advice, and the paging caveat in that order. The parenthetical enumeration of constraint types partly duplicates the schema enum, which is the only wasted space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

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

There is no output schema, and the description compensates by naming what each result carries (type-specific details, source file and line) and how paging behaves. That is sufficient for an agent to call and interpret it, though return shape is described only in outline.

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 baseline is 3, but the description adds genuine semantics: the `target` shorthand behavior (bare definition name → all constraints plus local definitions) is not expressed in the schema, and it flags the constraint-type filtering intent. This goes beyond restating field descriptions.

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 (List) and resource (OSCAL Metaschema constraints) and enumerates the constraint kinds returned. It also distinguishes itself from get_allowed_values, so an agent can tell the two apart 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?

Explicitly says when to use it ("rules the JSON schema does not express") and names the alternative (get_allowed_values) with the condition that selects it ("for the values themselves"). 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.