Skip to main content
Glama

execute_typescript

Run TypeScript code with Canvas API credentials in a sandboxed Node.js environment. Save tokens by executing bulk operations.

Instructions

Execute TypeScript code in a Node.js environment with access to Canvas API.

    IMPORTANT: This achieves 99.7% token savings for bulk operations!
    Code runs in a sandboxed Node.js environment with Canvas API credentials,
    all TypeScript modules in src/canvas_mcp/code_api/, and standard Node.js modules.

    IMPORTANT: Security is best-effort unless container sandboxing is available.
    Code runs in a temp file (deleted after), with optional network allowlist,
    timeout, memory, and CPU limits.

    Args:
        code: TypeScript code to execute; can import from './canvas/*' modules.
        timeout: Max execution time in seconds (default: 120).
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
timeoutNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description fully discloses behavior: sandboxed Node.js environment, temp file deletion, optional network allowlist, timeout, memory, and CPU limits, and best-effort security. This is comprehensive.

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

Conciseness4/5

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

The description is informative and well-structured, with bulleted args and highlighted important points. Some verbosity with uppercase IMPORTANT, but still efficient and easy to parse.

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 there is an output schema, the description does not need to explain return values. It covers both parameters, provides crucial context about token savings and security, and is complete for the tool's complexity.

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

Parameters5/5

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

The description adds meaning beyond the input schema: 'code' is explained as TypeScript code with import capability, and 'timeout' is described as max execution time in seconds with default. Schema coverage is 0%, so description fully compensates.

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 'Execute TypeScript code in a Node.js environment with access to Canvas API,' specifying the verb, resource, and environment. It also mentions the ability to import from './canvas/*' modules, distinguishing it from sibling tools that are primarily Canvas CRUD operations.

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 explicit guidance on when to use (99.7% token savings for bulk operations) and important security considerations. While it doesn't explicitly state when not to use or compare with alternatives, the context is clear.

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/vishalsachdev/canvas-mcp'

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