Skip to main content
Glama
HeshamFS

MCP Materials Server

by HeshamFS

get_properties

Retrieve comprehensive material properties from Materials Project database using a material ID. Returns detailed JSON data for analysis and research applications.

Instructions

Get detailed properties for a specific material from Materials Project.

Args:
    material_id: Materials Project ID (e.g., "mp-149" for Silicon)

Returns:
    JSON with comprehensive material properties

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
material_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler for the 'get_properties' tool. This function is decorated with @mcp.tool(), which registers it as an MCP tool. It takes a material_id, checks the Materials Project API key, fetches summary data using MPRester, extracts thermodynamic, electronic, symmetry, and other properties, and returns a formatted JSON response.
    def get_properties(
        material_id: str,
    ) -> str:
        """
        Get detailed properties for a specific material from Materials Project.
    
        Args:
            material_id: Materials Project ID (e.g., "mp-149" for Silicon)
    
        Returns:
            JSON with comprehensive material properties
        """
        has_key, key_or_error = check_api_key()
        if not has_key:
            return json.dumps({"error": key_or_error})
    
        try:
            from mp_api.client import MPRester
    
            with MPRester(key_or_error) as mpr:
                doc = mpr.materials.summary.get_data_by_id(material_id)
    
                properties = {
                    "material_id": str(doc.material_id),
                    "formula": doc.formula_pretty,
                    "elements": [str(el) for el in doc.elements],
                    "nelements": doc.nelements,
                    "nsites": doc.nsites,
                    "volume": doc.volume,
                    "density": doc.density,
    
                    # Thermodynamic properties
                    "formation_energy_per_atom": doc.formation_energy_per_atom,
                    "energy_above_hull": doc.energy_above_hull,
                    "is_stable": doc.is_stable,
    
                    # Electronic properties
                    "band_gap": doc.band_gap,
                    "is_metal": doc.is_metal,
                    "is_magnetic": doc.is_magnetic,
                    "total_magnetization": doc.total_magnetization,
    
                    # Symmetry
                    "crystal_system": str(doc.symmetry.crystal_system.value) if doc.symmetry and hasattr(doc.symmetry.crystal_system, 'value') else (str(doc.symmetry.crystal_system) if doc.symmetry else None),
                    "space_group_symbol": doc.symmetry.symbol if doc.symmetry else None,
                    "space_group_number": doc.symmetry.number if doc.symmetry else None,
                    "point_group": doc.symmetry.point_group if doc.symmetry else None,
    
                    # Provenance
                    "database_ids": doc.database_IDs if hasattr(doc, 'database_IDs') else None,
                }
    
                return json.dumps(properties, indent=2)
    
        except Exception as e:
            return json.dumps({"error": str(e)})
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it returns 'JSON with comprehensive material properties', which gives some output context, but lacks details on permissions, rate limits, error handling, or whether it's a read-only operation. For a tool with no annotations, this leaves significant behavioral gaps.

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 appropriately sized and front-loaded, with a clear purpose statement followed by concise sections for Args and Returns. Every sentence earns its place, providing essential information without unnecessary elaboration, making it efficient and well-structured.

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 low complexity (1 parameter), no annotations, and the presence of an output schema (which handles return values), the description is reasonably complete. It covers the purpose, parameter semantics, and output format, though it could benefit from more behavioral context or usage guidelines to be fully comprehensive.

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?

The description adds meaningful semantics beyond the input schema, which has 0% description coverage. It explains that 'material_id' is a 'Materials Project ID' and provides an example ('mp-149' for Silicon), clarifying the parameter's purpose and format, which compensates well for the schema's lack of documentation.

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 clearly states the verb 'Get' and resource 'detailed properties for a specific material from Materials Project', making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_structure' or 'get_elastic_properties', which might retrieve similar but more specific data.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention siblings like 'search_materials' for finding materials or 'get_elastic_properties' for specific property subsets, leaving the agent to infer usage context without explicit direction.

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/HeshamFS/mcp-materials-server'

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