Skip to main content
Glama

ts_execute

Run a JavaScript script with access to codebase tools, enabling multi-step operations like symbol lookup and dependency analysis in a single execution.

Instructions

Run a JS script in a Node sandbox with a typed facade. The script body executes as async () => { <body> }; use await tools.<name>(args) to call any allowed tool (find_symbol, get_function_source, get_dependents, search_codebase, replace_symbol_source, etc.). Return the final value. Collapses find->read->deps chains into one round-trip.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesJS function body. Use `await tools.foo(args)` then `return value`.
timeout_msNoMax script wall-clock in ms (default 30000).
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the async execution model, the mechanism to call other tools, and the chain collapsing behavior. It lacks details on error handling and sandbox restrictions but is largely transparent.

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 three concise sentences, front-loading the main purpose and providing essential details without wasting words.

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 and lack of output schema, the description explains the script execution model but does not specify the return value format or error behavior, leaving some gaps.

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 coverage is 100%, so parameters are already well-described. The description reinforces the script parameter's format but adds no new meaning beyond the schema. The timeout parameter is not mentioned in the description.

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 it runs a JS script in a Node sandbox, explains the script body format, and distinguishes from sibling tools by highlighting that it collapses find->read->deps chains into one round-trip, which is a key differentiator.

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?

It provides clear guidance on how to construct the script body and lists allowed tools, implying it should be used to combine multiple tool calls. However, it does not explicitly state when not to use it or provide alternatives.

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/Mibayy/token-savior'

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