Skip to main content
Glama
Giorgio089

dataframe-detective-mcp

by Giorgio089

query_dataset

Run pandas code on a loaded dataset in a sandboxed subprocess to answer data questions and return the computed result.

Instructions

Run pandas code against a dataset in a restricted subprocess.

df, pd and np are preloaded. Do not import anything. Put the answer, as a string, in a variable called result. Use f-strings (str.format is blocked). Example: result = df.groupby('channel')['revenue'].sum().sort_values(ascending=False).head(5).to_string()

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
nameYes
timeout_secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the sandbox ('restricted subprocess'), the preloaded namespaces, the import ban, the str.format block, and the result-variable contract. It still omits failure behavior (exceptions, timeouts) beyond the schema's default timeout.

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?

Front-loaded one-line purpose followed by tightly ordered constraints and a concrete example; no filler sentences and every line earns its place.

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?

An output schema exists so return-format explanation is unnecessary, and the description adequately covers the sandbox contract that an agent needs to write working code. It falls short only on identifying what `name` refers to and how the timeout interacts with execution.

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 thoroughly explains `code` (result convention, f-strings, example) but leaves `name` and `timeout_seconds` undocumented — `name` is only loosely implied by 'against a dataset', and the timeout is never mentioned.

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?

States a precise verb+resource ('Run pandas code against a dataset') plus the execution mechanism ('restricted subprocess'), which cleanly separates it from siblings like describe_dataset or profile_dataset that also touch datasets but do not execute user code.

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?

It gives strong operational guidance for the code parameter (preloaded names, no imports, put the answer in `result`), but it never says when to choose this tool over describe_dataset/profile_dataset or when a natural-language alternative is preferable. Usage is implied rather than routed.

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