Skip to main content
Glama

define_type

Create a validated user-defined ontology type and append it to ontology-user.yaml, enforcing unique names, canonical parent types, and allowed field types before writing.

Instructions

Define a new user type and append it to ontology-user.yaml. Returns {"defined": true, "name": str, "extends": str} on success, or {"defined": false, "errors": [...]} if validation fails.

Rules enforced before writing:

  • name must not collide with any canonical or existing user type

  • extends must name a canonical root type (not a user type, and not skill, which extends procedure)

  • all user-defined fields are optional; inherited fields cannot be redefined

  • field type must be one of: string | array | datetime | enum | boolean

Args: name: New type name (lowercase, hyphenated) extends: Canonical root parent type (document, article, task, procedure, etc.) description: Short description of what this type represents fields: Optional extra fields: [{name, type, values?}]. Omit 'values' for non-enum fields.

Input Schema

NameRequiredDescriptionDefault
nameYes
fieldsNo
extendsYes
descriptionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.0

TDQS

A4.2/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 well: it names the target file (ontology-user.yaml), states the success and failure return shapes including an `errors` array, and enumerates validation invariants checked before writing. It stops short of saying whether an existing definition is overwritten or whether a vault root must be set first.

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 purpose, then return contract, then rules, then args — a sensible order with little waste. The rules and args sections partially restate each other (e.g. the `extends` constraint appears in both), costing a bit of length.

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?

No output schema exists, but the description supplies both success and failure return shapes, cutting rules, and per-parameter constraints — enough to call it correctly. Missing only write semantics on re-definition (overwrite vs error) and any prerequisite about the vault root.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate, and it does: name (lowercase, hyphenated), extends (canonical root only, not a user type, not `skill`), description, and fields with the `values?` rule for enums plus the allowed type set. That is materially more than the bare schema types convey.

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 — "Define a new user type and append it to ontology-user.yaml" — and names the exact artifact mutated. An agent can distinguish it from `validate_type` (checks) and `define_relation` (relations) without opening any schema.

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?

Usage is implied by the enumerated pre-write rules, which tell the agent what will be rejected, but there is no explicit when-to-use or when-not-to-use guidance. It never points at the obvious alternative `validate_type` as a pre-check, even though it is the natural sibling for that purpose.

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