Skip to main content
Glama

defineSchema

Registers a JSON Schema in the dynamic-ontology registry to attach validation for custom entity-kind properties or new event types.

Instructions

Register a JSON Schema document in the dynamic-ontology schema registry. Use this to attach validation schemas for custom entity-kind properties (schemaKind=entityKind:vehicle) or to define schemas for new event types. Inputs: schemaKind (bare camelCase or colon-namespaced, e.g. entityKind:deal), version (semver vX.Y.Z), definition (JSON Schema object). Core schema kinds (entity, episode, etc.) are protected and return E_VALIDATION. The schema is immediately usable for property validation via ValidateEntityProperties. Returns E_VALIDATION if the definition is not a JSON object or if schemaKind is a protected core kind.

Input Schema

NameRequiredDescriptionDefault
previewNoWhen true, compute and return a plan (supersede or register) WITHOUT appending any event. Use this to inspect impact before committing. Default false.
versionYesSemver version, e.g. v0.1.0. Higher versions replace lower ones; same version with a different definition is a conflict.
definitionYesJSON Schema document (Draft 2020-12) to register. Must be a JSON object.
schemaKindYesLookup key for the schema, e.g. entityKind:vehicle or myCustomEvent. Bare camelCase or colon-namespaced. No spaces. Core kinds (entityKindRegistered, schemaRegistered, predicateRegistered, entity, episode, etc.) cannot be overwritten.

Output Schema

NameRequiredDescriptionDefault
planNoPresent only when preview=true. Describes what the call would do.
statusYesregistered = schema written to the event log; preview = plan computed without writing any event (preview=true was set).
versionYesThe registered schema version.
warningsNoNon-fatal advisory warnings. MAZ-SCHEMA-001 = supersede; MAZ-SCHEMA-002 = orphaned fields.
schemaKindYesThe registered schema kind identifier.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/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 and does reasonably well: it discloses that core schema kinds are protected, that E_VALIDATION is returned for non-object definitions or protected kinds, and that schemas become immediately usable via ValidateEntityProperties. It omits auth/permission requirements and doesn't describe the preview/dry-run behavior, which is only in the schema.

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?

It is front-loaded with the core action and use cases in a compact four-sentence block. The repeated E_VALIDATION mentions are slightly redundant, but nothing is wasted at a structural level.

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?

For a mutation tool with an output schema present, the description covers purpose, use cases, protection rules, and error conditions. The preview parameter and version-conflict behavior are left entirely to the schema, which is acceptable given 100% schema coverage, but mentioning preview would strengthen it.

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 coverage is 100%, so the schema already documents all four parameters, including preview and version-conflict semantics. The description mentions the same shapes (bare camelCase or colon-namespaced, semver) but adds little beyond the schema, so the baseline 3 is appropriate.

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 opens with a specific verb and resource: 'Register a JSON Schema document in the dynamic-ontology schema registry.' It distinguishes the tool from siblings like defineEntityKind and definePredicate by naming the schema-kinds it applies to (entityKind:vehicle, new event types).

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

Usage Guidelines4/5

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

It gives clear contexts for use: attaching validation schemas for custom entity-kind properties, or defining schemas for new event types. It also states the 'when not' case for protected core kinds. It does not explicitly name a sibling alternative (e.g., defineEntityKind), so it falls short of a 5.

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