Skip to main content
Glama

Create Data Type

create_data_type

Define a custom data type to track new events or metrics, including custom fields, units, and value labels, so you can record and organize structured data.

Instructions

Create a user-defined data type so the user can track something new.

For new tracking prefer base_type "event" (something that happens, at a time or over a range) or "metric" (a measured number); both can add custom fields. The older annotation bases "moment", "duration", "boolean", "numeric" and "scale" (a 1-5 rating) still work but take no fields.

Record with record_data (custom fields go in its fields); get_data_catalog(data_type=) lists a type's fields; get_records reads it back. Reversible with archive_data_type.

Input Schema

NameRequiredDescriptionDefault
nameYesHuman-readable name (e.g. "Caffeine Intake").
tagsNoTag names to attach; missing tags are created. Annotation bases only.
unitNoUnit for recorded values (e.g. "mg"). metric/numeric only.
scaleNoValue range, {"min": 1, "max": 10, "step": 1}. metric only.
fieldsNoJSON Schema of custom fields. event/metric only. E.g. {"properties": {"mood": {"type": "string"}}, "required": ["mood"]}.
base_typeYesWhat kind of values this type records (see above).
value_mapNoLabels for values, e.g. {"1": "low", "5": "high"}. metric only.
descriptionNoWhat the type tracks. Required for event/metric.
metric_kindNo"cumulative" or "discrete". metric/boolean/numeric/scale only.
scale_labelsNoExactly 5 labels for the 1-5 scale values. scale only.
default_valueNoValue pre-filled when recording. boolean/numeric only.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed34 schema fields changedv1.18.7
    • removedInput schema / properties / default_value / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / default_value / default
      Removed value: -null
    • addedInput schema / properties / default_value / type
      Added value: +"string"
    • removedInput schema / properties / description / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / description / default
      Removed value: -null
    • addedInput schema / properties / description / type
      Added value: +"string"
    • addedInput schema / properties / fields / additionalProperties
      Added value: +true
    • removedInput schema / properties / fields / anyOf
      Removed value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / fields / default
      Removed value: -null
    • addedInput schema / properties / fields / type
      Added value: +"object"
    • removedInput schema / properties / metric_kind / anyOf
      Removed value: -[
      -  {
      -    "enum": [
      -      "cumulative",
      -      "discrete"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / metric_kind / default
      Removed value: -null
    • addedInput schema / properties / metric_kind / enum
      Added value: +[
      +  "cumulative",
      +  "discrete"
      +]
    • addedInput schema / properties / metric_kind / type
      Added value: +"string"
    • addedInput schema / properties / scale / additionalProperties
      Added value: +{
      +  "type": "integer"
      +}
    • removedInput schema / properties / scale / anyOf
      Removed value: -[
      -  {
      -    "additionalProperties": {
      -      "type": "integer"
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / scale / default
      Removed value: -null
    • addedInput schema / properties / scale / type
      Added value: +"object"
    • removedInput schema / properties / scale_labels / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / scale_labels / default
      Removed value: -null
    • addedInput schema / properties / scale_labels / items
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / scale_labels / type
      Added value: +"array"
    • removedInput schema / properties / tags / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / tags / default
      Removed value: -null
    • addedInput schema / properties / tags / items
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / tags / type
      Added value: +"array"
    • removedInput schema / properties / unit / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / unit / default
      Removed value: -null
    • addedInput schema / properties / unit / type
      Added value: +"string"
    • addedInput schema / properties / value_map / additionalProperties
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / properties / value_map / anyOf
      Removed value: -[
      -  {
      -    "additionalProperties": {
      -      "type": "string"
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / value_map / default
      Removed value: -null
    • addedInput schema / properties / value_map / type
      Added value: +"object"
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "type": "object",
      -  "x-fastmcp-wrap-result": true
      -}New value: +null
  2. Addedv1.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare non-read-only, non-destructive, closed-world, so the mutation profile is covered. The description adds genuine context beyond that: the operation is reversible via archive_data_type, and the base_type choice constrains whether fields can be used at all. It does not describe what the response returns or whether an error occurs on duplicate names, which keeps it below a 5.

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?

Four short sentences, front-loaded with the purpose, then base_type selection, then follow-up tools, then reversibility. No filler despite an 11-parameter tool; each sentence carries distinct routing or constraint information.

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 an 11-parameter, nested-object creation tool with no output schema, the description covers the hardest decision (which base_type) and the lifecycle (record, inspect, archive). Minor gaps remain around error/duplicate handling and validation failures when fields are passed to legacy base types.

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 would be 3, but the description adds real semantic value the schema lacks: it explains the semantic distinction among base_type values (event vs metric vs legacy annotation bases) and the field-support constraint that the enum itself only hints at with "see above."

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 ("Create a user-defined data type") plus the intent (track something new), and immediately disambiguates the seven-way base_type enum by explaining what event/metric mean versus the legacy annotation bases. An agent can tell this apart from update_data_type or record_data without opening a schema.

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?

Gives clear in-tool guidance for choosing a base_type ("For new tracking prefer event or metric") and flags that legacy bases take no custom fields. It also routes forward to record_data, get_data_catalog, get_records, and archive_data_type. What it omits is when NOT to use this tool — namely updating an existing type via the sibling update_data_type, or checking the catalog first to avoid duplicates.

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