Skip to main content
Glama

test_code_snippet

Execute a Jython snippet, compare its returned result with an expected value, and optionally validate with a dry run before confirmed execution.

Instructions

Execute a snippet and compare the result with an expected value.

Args: code: Jython snippet to run. project: Project context. expected_result: Optional value to compare against the returned result. confirm: Must be True to execute. dry_run: Validate without executing.

Returns: The result, whether it matched, and any error text.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "test_code_snippet"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
confirmNo
dry_runNo
projectNo
expected_resultNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full disclosure burden. It does disclose the safety gates (confirm gating execution; dry_run as validation-only) and the return shape (result, match status, error text). Still, it never says what executing a Jython snippet in a project context can change, whether side effects persist under dry_run, or what permissions are required — significant gaps for a code-execution tool.

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 structured as a one-line purpose followed by Args and Returns, so each entry is scannable. It front-loads the core purpose before the parameter list. The wording is economical, with only slightly repetitive return text given that an output schema already exists.

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?

The purpose and parameters are documented adequately for a 5-parameter tool, and the output schema means return values need no further explanation. With no annotations, however, the description should disclose execution side effects and permission expectations for running arbitrary Jython in a project context. Those are absent, leaving a real gap for a tool of this risk profile.

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 compensate, and it largely does: it names the language of code (Jython), defines confirm as an execution gate rather than a plain flag, defines dry_run as validate-only, and explains expected_result as an optional comparison value. The main weakness is that project is only described as 'Project context', with no format or whether it is a name or path.

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 states a concrete verb and resource: execute a code snippet and compare the result with an expected value. This is much more specific than a tautology, and it distinguishes the tool as an execution-and-assertion tool. It does not explicitly contrast with siblings such as test_named_query or analyze_script, which is why this is not a 5.

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

Usage Guidelines3/5

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

The args reveal usage constraints: confirm must be True to execute, and dry_run validates without executing. From these, an agent can infer a preview-then-execute flow. However, nothing states when to choose this tool over test_named_query, analyze_script, or access_script_console, and there are no explicit exclusions.

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

Deploy Server

Other Tools