Skip to main content
Glama

JIT Tool Synthesis v2

LLM-powered on-demand tool generation with human-in-the-loop approval and safe execution.

Overview

This system generates TypeScript tools dynamically using an LLM, requires human approval before execution, and runs them in a sandboxed environment.

Architecture

┌─────────────┐ ┌──────────────┐ ┌─────────────┐ │ Synthesizer │────▶│ Approval │────▶│ Sandbox │ │ (LLM) │ │ (Human Gate) │ │ (Execution) │ └─────────────┘ └──────────────┘ └─────────────┘ │ │ │ ▼ ▼ ▼ Generates TS Waits for Runs in tool code human approval isolated env

Components

File

Purpose

synthesizer.ts

Generates TypeScript code using OpenRouter LLM

approval.ts

Human-in-the-loop gate — requires approval before execution

sandbox.ts

Safe execution environment for generated code

registry.ts

Tool persistence and storage

server.ts

MCP server integration

Setup

# Install dependencies npm install # Copy environment template cp .env.example .env # Add your OpenRouter API key to .env OPENROUTER_API_KEY=your_key_here

Usage

Start the MCP Server

npm run dev

Claude Desktop Integration

Import the config:

# Copy Claude Desktop config cat claude-desktop-config.json

Add the JSON to your Claude Desktop settings under mcpServers.

CLI Commands

# Generate and approve a tool npm run cli -- synthesize "Create a weather tool that fetches from wttr.in" # List available tools npm run cli -- list # Execute a tool npm run cli -- execute <tool-id>

Workflow

  1. Request — User asks for a tool (e.g., "create a weather fetcher")

  2. Synthesize — LLM generates TypeScript code

  3. Approve — Human reviews and approves the code

  4. Execute — Tool runs in sandboxed environment

  5. Store — Approved tools persist in registry

Environment Variables

Variable

Description

OPENROUTER_API_KEY

API key for LLM tool generation

PORT

Server port (default: 3000)

Status

In Progress — MVP complete, end-to-end testing in progress.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EyeSeeThru/jit-tool-synthesis'

If you have feedback or need assistance with the MCP directory API, please join our Discord server