Skip to main content
Glama

execute_code

Run MATLAB code to execute computations, generate outputs, and manage variables within a MATLAB session.

Instructions

Execute MATLAB code.

Runs the given MATLAB code string in the session's engine. Returns a result dict with status, job_id, output, variables, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions that it 'Runs the given MATLAB code string' and returns a result dict, but lacks critical behavioral details: it doesn't specify if this is a blocking or async operation, potential side effects (e.g., variable creation), error handling, or execution limits. The description adds some context but is insufficient for a mutation tool with zero annotation coverage.

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 appropriately sized and front-loaded: the first sentence states the core purpose, and subsequent sentences add necessary details about execution and return values. There's no wasted text, but it could be slightly more structured (e.g., bullet points for return fields). Overall, it's efficient but not exemplary.

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 complexity (a code execution tool with potential side effects), no annotations, 1 parameter with 0% schema coverage, but an output schema exists, the description is partially complete. It covers the basic action and return structure, but lacks details on execution behavior, error cases, and integration with siblings (e.g., job management). The output schema mitigates some gaps, but more context is needed for safe 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 0%, so the description must compensate. It adds meaning by specifying that the 'code' parameter is a 'MATLAB code string' and runs in the 'session's engine', which clarifies the parameter's purpose beyond the schema's basic type. However, it doesn't detail constraints (e.g., length, syntax) or examples, leaving gaps. With 1 parameter, baseline is 4, but the minimal compensation lowers it to 3.

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: 'Execute MATLAB code' specifies the verb (execute) and resource (MATLAB code). It distinguishes from siblings like 'check_code' (which likely validates) or 'get_job_result' (which retrieves results). However, it doesn't explicitly contrast with 'run_script' if that were a sibling, so it's not a perfect 5.

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 minimal guidance: it implies usage for running code in a session's engine, but offers no explicit when-to-use rules, prerequisites, or alternatives. For example, it doesn't clarify when to use this vs. 'check_code' or 'get_job_result', or mention session requirements. This leaves the agent with little context for tool selection.

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/HanSur94/matlab-mcp-server-python'

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