Type introspection
Status: Supported
Milestone: 4
Spec: Core concepts §3, Module architecture §8
Package: internal/types, internal/modules, modules/type-catalog
Goal
Expose the local type catalog for listing, describing, exporting, and validating
TTD schemas via CLI and MCP. Validation checks TTD envelope and JTD
well-formedness only (ParseTypeDefinition + Compile); payload validation
against registered types remains at emit time.
Built-in module
type-catalog is bundled like mcp-query. It declares:
- CLI command
typeswith subcommandslist,describe,export,validate - MCP tools
list_types,describe_type,export_type,validate_type_schema
Core RPCs
Modules reach the catalog through CoreServices:
| RPC | Purpose |
|---|---|
ListTypes |
Summaries for all registered types (optional source_filter) |
GetType |
Summary + JTD definition for one URI |
ExportType |
Canonical TTD bytes from blob store |
ValidateTypeDefinition |
Parse and compile arbitrary TTD JSON |
CLI
trove -config trove.toml types list [--json] [--source <filter>]
trove -config trove.toml types describe <uri> [--json]
trove -config trove.toml types export <uri> [-o <file>]
trove -config trove.toml types validate [--file <path>] # stdin when omitted
MCP
| Tool | Arguments | Result |
|---|---|---|
list_types |
optional source |
JSON array of type summaries |
describe_type |
uri |
summary + definition |
export_type |
uri |
canonical TTD JSON + schema_ref |
validate_type_schema |
schema (JSON) |
{valid, uri?, error?} |
Tools are registered via mcp-query at POST /mcp like other module tools.
Acceptance criteria
- [x] Catalog introspection RPCs on
CoreServices - [x] Bundled
type-catalogmodule with CLI + MCP surfaces - [x]
types listshows builtins fromtypes/builtin/ - [x]
types exportreturns blob-stored canonical TTD bytes - [x]
types validateandvalidate_type_schemaaccept raw TTD JSON - [x] Concept and roadmap updated