Skip to main content
Glama
devantage

mcp-pandas

by devantage

run_pandas_code

Execute pandas code in a restricted sandbox, optionally preloading a CSV/Excel file, and return the result as structured records.

Instructions

Execute pandas code in a restricted sandbox and return result.

pd (pandas) and np (numpy) are in scope; when file_path is given, the file is loaded into a DataFrame named df. The code must assign its output to result. For safety, filesystem/process/interpreter access (import, open, exec, eval, os/sys/…) is rejected. DataFrame/Series results are returned as records.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPython/pandas code to run. `pd` and `np` are available; assign the final output to a variable named `result`.
file_pathNoOptional CSV/Excel file to preload as a DataFrame named `df` before running the code.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations provided, so the description carries the full burden. It describes the sandbox, restricted operations (import, open, exec, etc.), and result format (records for DataFrames/Series). It does not mention timeouts or error handling, but the critical safety behaviors are covered.

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 concise (~100 words) and well-structured, with the main action first, followed by scope, file loading, assignment rule, safety restrictions, and result format. Every sentence provides necessary information without redundancy.

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?

Given the tool's complexity (code execution) and no annotations, the description covers allowed operations, restricted actions, file integration, and output format. It is mostly complete but could mention error behavior or limits for better agent guidance.

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 coverage is 100%, so baseline is 3. The description adds value by explaining the scoped libraries (pd, np), the preloading of file_path into a DataFrame df, and the assignment requirement. This goes beyond the schema descriptions.

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 pandas code in a restricted sandbox and returns the result. It distinguishes itself from sibling tools like generate_chartjs, read_metadata, and interpret_column_data by being the only tool that runs arbitrary code.

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 clear context on how to use the tool (available libraries, file loading, assignment to result) but does not explicitly state when not to use it or mention alternatives. It is adequate but lacks exclusions or comparison hints.

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/devantage/mcp-pandas'

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