Skip to main content
Glama

Síntesis de herramientas JIT v4

Generación de herramientas bajo demanda impulsada por LLM con aprobación humana y ejecución segura.

Descripción general

Este sistema genera herramientas de TypeScript de forma dinámica utilizando un LLM, requiere aprobación humana antes de la ejecución y las ejecuta en un entorno aislado (sandbox).

Related MCP server: code2mcp

Arquitectura

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

Componentes

Archivo

Propósito

synthesizer.ts

Genera código de herramientas usando cualquier LLM compatible con OpenAI

approval.ts

Puerta de control con intervención humana: requiere aprobación antes de la ejecución

sandbox.ts

Entorno de ejecución seguro para el código generado

registry.ts

Persistencia y almacenamiento de herramientas

server.ts

Integración del servidor MCP

config.ts

Gestión de configuración en tiempo de ejecución

Independiente del proveedor

Esta herramienta funciona con cualquier API de LLM compatible con OpenAI:

  • OpenRouter — Más de 100 modelos (Claude, GPT, Llama, etc.)

  • OpenAI — GPT-4o, o3, etc.

  • Ollama — Modelos locales (Llama, Qwen, etc.)

  • LM Studio — Modelos locales con interfaz gráfica

  • Groq — Inferencia rápida

  • Cualquier otra API compatible con OpenAI

Configuración

# Install dependencies
npm install

# Copy environment template
cp .env.example .env

Configura tu proveedor de LLM

Edita .env con los detalles de tu proveedor:

# Option 1: OpenRouter (default - 100+ models)
LLM_API_KEY=your-openrouter-key
LLM_BASE_URL=https://openrouter.ai/api/v1
LLM_MODEL=anthropic/claude-sonnet-4-6

# Option 2: OpenAI direct
LLM_API_KEY=sk-...
LLM_BASE_URL=https://api.openai.com/v1
LLM_MODEL=gpt-5.4

# Option 3: Ollama (local)
LLM_BASE_URL=http://localhost:11434/v1
LLM_MODEL=llama-3.3

# Option 4: Groq
LLM_API_KEY=gsk_...
LLM_BASE_URL=https://api.groq.com/openai/v1
LLM_MODEL=llama-3.3-70b-versatile

Uso

Compilación

npm run build

Prueba con el inspector MCP

La forma más rápida de verificar que todo funciona:

npx @modelcontextprotocol/inspector node dist/server.js

Conexión a clientes MCP

Este servidor funciona con cualquier cliente MCP. Ejemplos de configuración:

Claude Desktop — añádelo a la configuración MCP de tu Claude Desktop:

{
  "mcpServers": {
    "jit-tool-synthesis": {
      "command": "node",
      "args": ["/absolute/path/to/jit-tool-synthesis/dist/server.js"],
      "env": {
        "LLM_API_KEY": "your-api-key",
        "LLM_BASE_URL": "https://openrouter.ai/api/v1",
        "LLM_MODEL": "anthropic/claude-sonnet-4-6"
      }
    }
  }
}

Claude Code:

claude mcp add jit-tools node /absolute/path/to/jit-tool-synthesis/dist/server.js

VS Code (Copilot):

code --add-mcp '{"name":"jit-tools","type":"stdio","command":"node","args":["/absolute/path/to/jit-tool-synthesis/dist/server.js"]}'

Cursor — añádelo a .cursor/mcp.json:

{
  "mcpServers": {
    "jit-tools": {
      "command": "node",
      "args": ["/absolute/path/to/jit-tool-synthesis/dist/server.js"],
      "env": { "LLM_API_KEY": "your-api-key" }
    }
  }
}

Configuración en tiempo de ejecución

Puedes cambiar el proveedor de LLM sin reiniciar:

# View current config
get_config

# Change model at runtime
set_config model=openai/gpt-5.4

Herramientas MCP

Herramienta

Descripción

synthesize_tool

Generar una nueva herramienta a partir de lenguaje natural

test_tool

Probar una herramienta pendiente con parámetros de muestra antes de la aprobación

approve_tool

Activar una herramienta pendiente

reject_tool

Descartar una herramienta pendiente

execute_tool

Ejecutar una herramienta aprobada

list_generated_tools

Listar todas las herramientas aprobadas

get_tool

Ver detalles de la herramienta

remove_tool

Eliminar una herramienta

list_pending

Listar herramientas en espera de aprobación

get_config

Ver la configuración del LLM

set_config

Cambiar el proveedor/modelo de LLM en tiempo de ejecución

Flujo de trabajo

  1. Solicitud — El usuario pide una herramienta (ej. "crea un conversor de colores")

  2. Síntesis — El LLM genera el código de la herramienta

  3. Prueba — Validar con parámetros de muestra antes de confirmar

  4. Aprobación — Un humano revisa y aprueba el código

  5. Ejecución — La herramienta se ejecuta en un entorno aislado

  6. Almacenamiento — Las herramientas aprobadas persisten entre sesiones

Variables de entorno

Variable

Descripción

Predeterminado

LLM_API_KEY

Clave API para tu proveedor

(requerido para la nube)

LLM_BASE_URL

Punto final de la API

https://openrouter.ai/api/v1

LLM_MODEL

Modelo a utilizar

anthropic/claude-sonnet-4-6

También se admite (legado): OPENROUTER_API_KEY, OPENAI_API_KEY, OPENAI_BASE_URL, SYNTHESIZER_MODEL

Seguridad

  • El código generado se ejecuta en un entorno aislado (sandbox) de VM

  • Los patrones bloqueados previenen código peligroso (process, require, eval, etc.)

  • Las claves API no se almacenan en el archivo de configuración

Estado

Listo para producción — Fase 1 completada.

Available Tools

8 tools
approve_toolApprove a synthesized toolD
ParametersJSON Schema
NameRequiredDescriptionDefault
tool_nameYes

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

execute_toolExecute an approved toolD
ParametersJSON Schema
NameRequiredDescriptionDefault
tool_nameYes
paramsYes

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_toolGet tool detailsD
ParametersJSON Schema
NameRequiredDescriptionDefault
tool_nameYes

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_pendingList pending toolsB

Returns a list of tools waiting for approval

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Returns a list') but doesn't cover critical aspects like permissions needed, pagination, rate limits, or what constitutes 'pending' status. This leaves significant gaps for a tool that likely interacts with an approval workflow.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without any fluff. It's front-loaded and wastes no words, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of managing pending tools in an approval system, the description is insufficient. With no annotations, no output schema, and siblings like 'approve_tool' and 'reject_tool', it should explain more about the approval context, return format, or how 'pending' is defined. It leaves too much undefined for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a high baseline score for not adding unnecessary information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Returns') and resource ('list of tools waiting for approval'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_tools' or 'get_tool', which might also retrieve tool information, so it falls short of a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as 'list_tools' or 'get_tool'. It lacks context about prerequisites, timing, or exclusions, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_toolsList all available toolsB

Returns a list of all approved and available tools

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns a list but doesn't specify format, pagination, sorting, or any constraints like rate limits or authentication needs. For a tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It is front-loaded and appropriately sized for a simple tool with no parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'approved and available' means, the return format, or how this tool interacts with siblings. For a tool in a context with multiple related tools, more detail is needed to ensure proper use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so the schema already documents this fully. The description doesn't need to add parameter details, and it appropriately doesn't mention any. Baseline for 0 parameters is 4, as it avoids unnecessary information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Returns') and resource ('a list of all approved and available tools'), making the purpose understandable. However, it doesn't explicitly distinguish this tool from sibling tools like 'get_tool' or 'list_pending', which might have overlapping or related functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_tool' (for a single tool) or 'list_pending' (for pending tools). It lacks explicit context, prerequisites, or exclusions, leaving usage unclear in relation to siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

reject_toolReject a synthesized toolD
ParametersJSON Schema
NameRequiredDescriptionDefault
tool_nameYes

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

remove_toolRemove an approved toolD
ParametersJSON Schema
NameRequiredDescriptionDefault
tool_nameYes

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

synthesize_toolSynthesize a new toolB

Describe a capability you need and this will generate a working tool. Returns a pending tool that needs approval before it becomes available.

ParametersJSON Schema
NameRequiredDescriptionDefault
descriptionYesWhat the tool should do
example_inputNoExample input to guide generation
example_outputNoExpected output format

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that the tool generates a pending tool requiring approval, which is useful behavioral context. However, it lacks details on permissions needed, rate limits, error conditions, or what 'pending' entails operationally (e.g., storage, visibility). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences that are front-loaded and efficient: the first states the action and input, the second specifies the output and approval requirement. Every sentence earns its place with no wasted words, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (generating new tools with 3 parameters), lack of annotations, and no output schema, the description is minimally adequate. It covers the core purpose and approval workflow but misses details like error handling, return format, or integration with siblings. It's complete enough for basic understanding but has clear gaps for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters ('description', 'example_input', 'example_output') with their purposes. The description doesn't add any parameter-specific semantics beyond what the schema provides, such as formatting tips or interdependencies. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'generate a working tool' based on a described capability, with the specific outcome of returning 'a pending tool that needs approval'. It uses specific verbs ('generate', 'returns') and identifies the resource ('tool'), but doesn't explicitly differentiate from siblings like 'approve_tool' or 'execute_tool' in terms of workflow role.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by stating it 'generates a working tool' and that the result 'needs approval before it becomes available', which suggests it's part of a tool creation workflow. However, it doesn't explicitly state when to use this versus alternatives like 'approve_tool' or 'execute_tool', nor does it provide clear exclusions or prerequisites for use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 8 tool updatesv2.0.0
    • First observedapprove_tool
    • First observedexecute_tool
    • First observedget_tool
    • First observedlist_pending
    • First observedlist_tools
    • First observedreject_tool
    • First observedremove_tool
    • First observedsynthesize_tool

TDQS

C2.4/5.0

Scored across 8 tools

Disambiguation4/5

Most tools have distinct purposes: list_pending and list_tools are clearly different (pending vs. all tools), synthesize_tool creates new tools, and approve_tool/reject_tool/remove_tool handle tool lifecycle. However, get_tool lacks a description, making its distinction from list_tools ambiguous—it might fetch a single tool's details, but this is unclear without context.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with snake_case, such as approve_tool, execute_tool, get_tool, list_pending, list_tools, reject_tool, remove_tool, and synthesize_tool. This uniformity makes the set predictable and easy to understand at a glance.

Tool Count5/5

With 8 tools, this server is well-scoped for managing a tool synthesis and approval workflow. The count supports core operations like listing, creating, approving, rejecting, removing, and executing tools, without being overly sparse or bloated.

Completeness4/5

The tool set covers a complete lifecycle for tool synthesis: create (synthesize_tool), list (list_pending, list_tools), approve/reject (approve_tool, reject_tool), remove (remove_tool), and execute (execute_tool). A minor gap is the lack of descriptions for tools like get_tool, which might hinder full coverage if it's meant for detailed retrieval, but the core workflow is well-supported.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    F
    maintenance
    Enables AI models to dynamically create and execute their own custom tools through a meta-function architecture, supporting JavaScript, Python, and Shell runtimes with sandboxed security and human approval flows.
    5
    10
    MIT
  • F
    license
    A
    quality
    Not graded
    maintenance
    Enables execution of TypeScript code to call MCP tools instead of direct tool calls, reducing token usage by up to 98% while orchestrating complex multi-tool workflows through secure sandboxed code execution.
    1
    -
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI-powered generation of production-ready CTP (ConveniencePro Tool Protocol) tools from natural language descriptions, including tool definitions, implementations, tests, and TypeScript validation.
    5
    7 npm
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables dynamic creation and execution of custom tools/functions in multiple programming languages at runtime, exposing them to MCP clients like Claude.
    4
    9 npm
    44
    MIT