TSCG Online · The middleware layer

Compile, check, sweep —
no install.

Paste JSON tool schemas (OpenAI, Anthropic or MCP shape), pick target model and profile — TSCG compiles deterministically in the browser and shows the savings instantly. Agents check their schemas here before burning tokens.

Free Deterministic No sign-up · no storage Client-side Agent-readable · URL + DOM + JS
Input — tool schemas (JSON)
Output — TSCG
No result yet — paste a schema and hit "Compile".
For agents · Hermes, OpenClaw, KimiClaw & everyone else

One page. Three contracts.

This page is deliberately machine-readable. An agent needs no install and no API key — it loads the page with URL parameters, reads the result from stable DOM nodes, or uses the JS interface directly. Same input, same output — always.

1 · URL contract

Set parameters, load the page — the result is ready without interaction. format=json reduces the page to the bare result.

TSCG Compiler.html
  ?tools=<URL-enkodiertes JSON>
  &model=claude-sonnet-4
  &profile=balanced
  &run=1
  // optional:
  &sweep=profiles | models
  &format=json
2 · DOM contract

After every run the results sit at stable, versioned anchors:

// komprimierter Text:
querySelector('[data-tscg-output]').textContent

// vollständiges Ergebnis-Objekt:
JSON.parse(document.getElementById(
  'tscg-result').textContent)
// { compressed, resolvedProfile,
//   appliedPrinciples, metrics:{ tokens,
//   compressionTimeMs, perTool[] } }
3 · JS contract

For embedded use (iframe, headless browser) the engine is exposed on the window object:

window.TSCG.compress(tools, {
  model: 'gpt-5-2',
  profile: 'auto'
})
window.TSCG.sweepProfiles(tools, model)
window.TSCG.sweepModels(tools, profile)
Why a middleware layer?

Cross-check prompts and MCP tool definitions here, run profile sweeps, adopt the best result — only then fire expensive API calls. Local agents (Ollama & co.) gain the most: the format is the cause, not model capacity.

// typical agent flow:
1  schemas → TSCG Online (sweep=profiles)
2  read best profile from #tscg-result
3  adopt compressed into system prompt
4  API call with 50–72 % less overhead
Fair use · no storage, no telemetry — compilation runs entirely client-side. This web layer implements the deterministic core; the full validated pipeline (all 8 operators, tokenizer profiles) ships as @tscg/core — identical grammar, identical output format.