Skip to main content
Glama

run_js

Execute JavaScript code snippets securely using Node.js in an isolated environment with configurable timeout and no network access.

Instructions

Ejecuta un fragmento de código JavaScript con Node.js y devuelve su salida.

El código corre en un subproceso separado con:

  • Timeout configurable (por defecto 10 segundos).

  • Sin acceso a red (variables de entorno anuladas).

  • Node.js debe estar instalado en el sistema.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesCódigo JavaScript a ejecutar.
timeoutNoTiempo máximo de ejecución en segundos (máximo 60).
stdinNoTexto a pasar como entrada estándar al programa.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/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 does an excellent job describing key behavioral traits: timeout configuration (default 10 seconds, maximum 60), execution in a separate subprocess, security constraints (no network access, overridden environment variables), and the prerequisite of Node.js installation. The only minor gap is not explicitly mentioning whether this is a read-only or destructive operation, though 'ejecuta' implies execution rather than data modification.

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 perfectly structured and concise. The first sentence states the core purpose, followed by bullet points that efficiently detail the execution environment and constraints. Every sentence earns its place with essential information, and there's no redundant or unnecessary content.

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

Completeness5/5

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

Given that this is a code execution tool with no annotations but with comprehensive input schema (100% coverage) and an output schema (confirmed in context signals), the description provides excellent contextual completeness. It covers the execution environment, security constraints, prerequisites, and behavioral characteristics, making it complete enough for an agent to understand when and how to use this tool effectively.

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?

With 100% schema description coverage, the schema already documents all three parameters thoroughly. The description doesn't add any additional parameter semantics beyond what's in the schema - it mentions timeout configuration generally but doesn't provide extra details about the code, timeout, or stdin parameters. This meets the baseline expectation when schema coverage is complete.

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

Purpose5/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 with a specific verb ('Ejecuta' - executes) and resource ('un fragmento de código JavaScript con Node.js'), distinguishing it from sibling tools like run_python (different language) and memory_* tools (different functionality). It precisely defines what the tool does without being tautological.

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

Usage Guidelines4/5

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

The description provides clear context about when to use this tool by specifying the execution environment (Node.js, separate subprocess) and constraints (no network access, overridden environment variables). However, it doesn't explicitly state when NOT to use it or mention alternatives like run_python for Python code execution, which would be helpful for sibling tool differentiation.

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

Install Server

Other Tools

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/YoshiLoL0526/mcp-toolkit'

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