Skip to main content
Glama
asanchezleache

ipython-kernel-mcp

execute_code

Execute Python code on a persistent IPython kernel, preserving variables between calls. Get stdout, results, and errors in a single output.

Instructions

Execute Python code on the connected IPython kernel.

Variables persist between calls. Output (stdout, results, errors) is collected and returned as a single string when execution completes.

Args: code: Python code to execute.

Returns: Execution output (stdout, expression results, or error messages).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations provided, the description carries the full disclosure burden. It usefully states that variables persist between calls and that all output (stdout, results, errors) is collected and returned as a single string when execution completes, which is valuable behavioral context. It does not mention potential side effects of running arbitrary code or timeout/interruption behavior, but the disclosed persistence and output capture are meaningful.

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 compact and well-structured: a one-sentence purpose, two sentences of behavioral context, and short Args/Returns sections. Every line contributes information and the format is easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter tool with an output schema, the description covers the action, the parameter, persistence, and return format. The only notable gaps are that it does not explicitly state the requirement to connect to a kernel first or mention that interrupt_kernel can stop a long-running execution, though 'connected IPython kernel' strongly implies the prerequisite.

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?

The input schema provides only the property name and type with 0% description coverage, so the description must explain the parameter. The Args section says 'code: Python code to execute,' which clarifies that the string is a code snippet rather than a file path or command. It adds little beyond restating the tool's purpose and gives no examples or constraints, so it only partially compensates for the missing schema descriptions.

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 first sentence states that the tool executes Python code on the connected IPython kernel, giving a specific verb and resource. It is immediately clear this is the tool for running code, and the sibling tools (connect, status, interrupt) are distinct actions. However, it does not explicitly compare itself to those siblings, so it stops short of a full 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 description implies usage only when a kernel is already connected ('connected IPython kernel'), but it gives no explicit guidance on when to use execute_code as opposed to kernel_status or interrupt_kernel. There is no stated prerequisite action such as 'call connect_to_kernel first', and no discussion of alternatives. This is sufficient to understand the basic purpose but leaves usage decisions mostly to inference.

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

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/asanchezleache/ipython-kernel-mcp'

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