Skip to main content
Glama
sdiehl
by sdiehl

create_coordinate_system

Define and generate a 3D coordinate system for vector calculus operations, allowing custom coordinate names or default labels for x, y, z axes.

Instructions

Creates a 3D coordinate system for vector calculus operations.

Args:
    name: The name for the coordinate system.
    coord_names: Optional list of coordinate names (3 names for x, y, z).
                If not provided, defaults to [name+'_x', name+'_y', name+'_z'].

Example:
    # Create a coordinate system
    coord_sys = create_coordinate_system("R")
    # Creates a coordinate system R with coordinates R_x, R_y, R_z

    # Create a coordinate system with custom coordinate names
    coord_sys = create_coordinate_system("C", ["rho", "phi", "z"])

Returns:
    The name of the created coordinate system.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coord_namesNo
nameYes

Implementation Reference

  • Handler function for the 'create_coordinate_system' MCP tool. Creates a SymPy CoordSys3D object, stores it in coordinate_systems dict, adds to expressions and local_vars.
    @mcp.tool()
    def create_coordinate_system(name: str, coord_names: Optional[List[str]] = None) -> str:
        """Creates a 3D coordinate system for vector calculus operations.
    
        Args:
            name: The name for the coordinate system.
            coord_names: Optional list of coordinate names (3 names for x, y, z).
                        If not provided, defaults to [name+'_x', name+'_y', name+'_z'].
    
        Example:
            # Create a coordinate system
            coord_sys = create_coordinate_system("R")
            # Creates a coordinate system R with coordinates R_x, R_y, R_z
    
            # Create a coordinate system with custom coordinate names
            coord_sys = create_coordinate_system("C", ["rho", "phi", "z"])
    
        Returns:
            The name of the created coordinate system.
        """
        if name in coordinate_systems:
            return f"Warning: Overwriting existing coordinate system '{name}'."
    
        try:
            if coord_names and len(coord_names) != 3:
                return "Error: coord_names must contain exactly 3 names for x, y, z coordinates."
    
            if coord_names:
                # Create a CoordSys3D with custom coordinate names
                cs = CoordSys3D(name, variable_names=coord_names)
            else:
                # Create a CoordSys3D with default coordinate naming
                cs = CoordSys3D(name)
    
            coordinate_systems[name] = cs
    
            # Add the coordinate system to the expressions dict to make it accessible
            # in expressions through parsing
            expressions[name] = cs
    
            # Add the coordinate variables to local_vars for easier access
            for i, base_vector in enumerate(cs.base_vectors()):
                vector_name = (
                    f"{name}_{['x', 'y', 'z'][i]}"
                    if not coord_names
                    else f"{name}_{coord_names[i]}"
                )
                local_vars[vector_name] = base_vector
    
            return name
        except Exception as e:
            return f"Error creating coordinate system: {str(e)}"
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 clearly describes the creation behavior, default values for coord_names, and the return value. However, it doesn't mention potential side effects (e.g., if it modifies global state), error conditions, or performance considerations, leaving some behavioral aspects unclear.

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 well-structured and appropriately sized. It starts with a clear purpose statement, followed by parameter explanations, and then practical examples. Every sentence adds value without redundancy, making it easy to understand quickly.

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 no annotations, 0% schema coverage, and no output schema, the description does an excellent job explaining parameters, behavior, and return values. However, it doesn't address potential errors or prerequisites, which would be helpful for a creation tool. The examples enhance completeness but some edge cases remain uncovered.

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?

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains the purpose of 'name' and provides detailed semantics for 'coord_names', including default behavior and examples. This fully compensates for the schema's lack of 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 the tool's purpose: 'Creates a 3D coordinate system for vector calculus operations.' It specifies the verb ('creates'), resource ('3D coordinate system'), and context ('for vector calculus operations'), distinguishing it from siblings like create_custom_metric or create_vector_field.

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 through examples but doesn't explicitly state when to use this tool versus alternatives like create_custom_metric or create_predefined_metric. It provides context for vector calculus operations but lacks explicit guidance on tool selection among siblings.

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

Related 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/sdiehl/sympy-mcp'

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