Skip to main content
Glama

run_script

Execute Wolfram Language scripts (.wl, .m) and get the result of the last expression with timing info. Definitions persist in the current session.

Instructions

Execute a Wolfram Language script file (.wl, .m) and return the result.

This is equivalent to Get[path] - loads and executes the script in the current kernel session. Any definitions or side effects persist.

Args: path: Path to the .wl or .m script file

Returns: The result of the last expression in the script, plus timing info

Example: run_script("~/scripts/setup.wl") -> {result: "Null", timing_ms: 150}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that side effects persist and that the script runs in the current kernel session. It does not cover error handling or file existence, but the basic behavioral traits are adequately communicated.

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 four sentences plus an example, all relevant and well-structured. The core action is stated first, followed by equivalent operation, behavior, and a concrete example. No unnecessary words.

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 the tool's simplicity (one parameter) and the presence of an output schema (implied by example), the description covers purpose, behavior, parameter, and return value. It is complete for an agent to use correctly.

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?

Schema description coverage is 0%, so the description must add meaning. It specifies the parameter as a path to .wl or .m files, which goes beyond the schema's type-only definition. More details like path resolution could be added, but it suffices for a single parameter.

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 executes a Wolfram Language script file (.wl, .m) and returns the result. It uses specific verbs like 'Execute' and 'loads and executes', and distinguishes from siblings by focusing on file execution rather than code evaluation or batch commands.

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 explains that it is equivalent to Get[path] and that definitions persist, implying use for script files where side effects are desired. It does not explicitly contrast with siblings like execute_code, but the context is clear enough for an AI agent to infer appropriate usage.

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/AbhiRawat4841/mathematica-mcp'

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