Developer Tools

TSCG: Deterministic Tool-Schema Compilation for Agentic LLM Deployments

TSCG converts JSON schemas into text 51% smaller, cutting tool-use failures to near-zero.

Deep Dive

Researcher Furkan Sakizli introduced **TSCG (Tool-Schema Compilation for Agentic LLM Deployments)**, a deterministic compiler that converts JSON tool schemas into token-efficient structured text without model access or fine-tuning. By resolving the protocol mismatch between machine-friendly JSON and LLM interpretation, TSCG restores Phi-4 14B's accuracy from 0% to 84.4% at 20 tools and achieves 108-181% accuracy-retained ratios across models on BFCL benchmarks.

TSCG combines eight composable operators with a formal compression bound of ≥51% for well-formed schemas, cutting tool-use failures at production scale. The 1,200-line zero-dependency TypeScript package delivers 52-57% token savings across heavy MCP schemas and generalizes synthetic benchmarks to real-world schemas within 0.1 accuracy points. Per-operator analysis reveals distinct operator-response profiles, offering deployment guidance for models like Opus 4.7, GPT-5.2, and Sonnet 4.

Key Points
  • TSCG boosts Phi-4 14B accuracy from 0% to 84.4% with 20 tools and 90.3% with 50 tools, fixing JSON-LLM schema mismatches.
  • Achieves 52-57% token savings and 108-181% accuracy retention across models, validated on 19K calls and real-world MCP schemas.
  • Ships as a 1,200-line TypeScript package with no dependencies, offering deterministic compilation and per-model deployment guidance.

Why It Matters

TSCG makes LLM agents 2x more reliable for enterprise tool use by shrinking schemas and cutting failures to near-zero.