Skip to main content
Glama
lichman0405

raspa-mcp

by lichman0405

parse_density_grid

Parse RASPA2 3D density grids to extract a 2D slice for visualization. Returns grid metadata and slice data, ready for plotting.

Instructions

Parse RASPA2 3D density grid files and extract a 2D slice (3-4).

RASPA2 writes .grid files when the simulation.input contains: WriteDensityProfile3DVTKGrid yes DensityAveragingTypeVTK number_of_molecules

The 3D grid is stored as Nx×Ny×Nz float values (row-major). This function returns the full grid metadata and ONE 2D slice. Pass the returned 'slice_data' field to plot_density_slice() to save a PNG.

KNOWN LIMITATION: This tool returns a 2D cross-section only, NOT a full 3D isosurface or volumetric render. For true 3D visualization (isosurfaces, volume rendering), export the raw 'slice_data' and use external tools such as VESTA, py3Dmol, or ParaView with the original .grid/.vtk file. To explore different planes, call this tool multiple times with different slice_axis ('x','y','z') and slice_index values.

KNOWN LIMITATION: The .grid ASCII format written by RASPA2 has minor variations across versions (header line count differs). If parsing fails (status='no_grid_files' or 'warning' in dataset), verify that WriteDensityProfile3DVTKGrid is set and check the raw file header.

Args: output_dir: Path to RASPA2 Output (or parent) directory. molecule: Optional filter on molecule name (e.g. "CO2"). slice_axis: Axis perpendicular to the slice: 'x'/'a', 'y'/'b', 'z'/'c'. slice_index: Grid-plane index along slice_axis; -1 = midpoint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
moleculeNo
output_dirYes
slice_axisNoz
slice_indexNo
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses known limitations (2D-only, not 3D), version-specific format variations, and failure status values ('status='no_grid_files' or 'warning''). It also states that it returns 'full grid metadata and ONE 2D slice.' While it doesn't explicitly state side effects (e.g., file system writes), the read-only nature is implied by its parse-and-return function. This is more than minimal disclosure, though not exhaustive.

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 well-structured with paragraphs and an Args list, but it runs a bit long due to two 'KNOWN LIMITATION' sections. However, every sentence carries useful information (format prerequisites, return data, version caveats, visualization alternatives). It is front-loaded with the core purpose and then provides supporting details. Slightly verbose but not bloated.

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 (file parsing, version variations, multiple parameters, no output schema), the description is quite complete. It covers RASPA2 prerequisites, return values (metadata and slice_data), how to visualize, failure modes, and parameter semantics. The only gap is the exact shape/type of the returned slice_data, but this is partially mitigated by the reference to plot_density_slice(). Overall, it provides sufficient context for safe selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description compensates excellently with an Args section that explains each parameter: output_dir (path), molecule (optional filter), slice_axis (with 'x'/'a' aliases), and slice_index (with -1 as midpoint). This adds practical meaning beyond the schema titles and defaults, giving the agent the exact semantics needed to select and pass values.

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 the tool's function: 'Parse RASPA2 3D density grid files and extract a 2D slice (3-4).' It also distinguishes from sibling tools by explicitly noting it returns a 2D slice and referencing plot_density_slice() for visualization, and further clarifies that it does NOT provide full 3D isosurfaces. This makes the tool's purpose specific and non-overlapping.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool and how to proceed: 'Pass the returned slice_data field to plot_density_slice() to save a PNG', 'For true 3D visualization... use external tools such as VESTA, py3Dmol, or ParaView', and 'To explore different planes, call this tool multiple times.' It also specifies the RASPA2 configuration needed to generate the .grid files, which is a clear prerequisite and alternative context.

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/lichman0405/raspa-mcp'

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