ScriptsMay 11, 2026·2 min read

TypeChat — Schema-First Natural Language UIs

Build typed natural language interfaces by turning intent into validated JSON via TypeScript types. Replace prompt engineering with schema engineering.

Agent ready

This asset can be read and installed directly by agents

TokRepo exposes a universal CLI command, install contract, metadata JSON, adapter-aware plan, and raw content links so agents can judge fit, risk, and next actions.

Stage only · 29/100Stage only
Agent surface
Any MCP/CLI agent
Kind
Script
Install
Single
Trust
Trust: Established
Entrypoint
README.md
Universal CLI install command
npx tokrepo install 6722eee5-8afd-4e50-9259-3a3ceb67e74f
Intro

Build typed natural language interfaces by turning intent into validated JSON via TypeScript types. Replace prompt engineering with schema engineering.

  • Best for: Product teams who need typed actions (APIs, workflows) from an LLM with validation and repair loops
  • Works with: TypeScript/JavaScript, any LLM backend, JSON schema-style validation flows
  • Setup time: 12 minutes

Quantitative Notes

  • Setup time ~12 minutes (npm install + run one example in the repo)
  • GitHub stars + forks (verified): see Source & Thanks
  • Typical loop: generate JSON → validate → repair (1–2 retries)

Practical Notes

If you’re building an agent that triggers actions, define a narrow union type for allowed intents and keep each intent payload minimal. Add deterministic validation (schema + business rules) and log all repairs—repairs are where many hidden bugs appear. Over time, grow the schema set rather than growing prompts.

Safety note: Always validate typed JSON with business rules (not just schema) before executing real actions.

FAQ

Q: Do I still need prompt engineering? A: Much less. You focus on defining types/schemas; prompts become smaller and more stable.

Q: How does it handle invalid JSON? A: It validates and can re-prompt the model to repair non-conforming output.

Q: Is it only for TypeScript apps? A: TypeChat provides TypeScript/JS support, and the repo also references other language variants.


🙏

Source & Thanks

GitHub: https://github.com/microsoft/TypeChat Owner avatar: https://avatars.githubusercontent.com/u/6154722?v=4 License (SPDX): MIT GitHub stars (verified via api.github.com/repos/microsoft/TypeChat): 8,652 GitHub forks (verified via api.github.com/repos/microsoft/TypeChat): 413

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets