Skip to main content
Glama

generate_coordinate

Generate random coordinate points in any dimensional space using specified value ranges. Ideal for game object positioning, particle systems, map generation, and spatial sampling in applications like 3D modeling or terrain mapping.

Instructions

Random Coordinate Generator

Generate random coordinate points in a specified dimensional space, each dimension has its own value range.
Supports coordinate generation in any number of dimensions.

Args:
    dimensions (int): Number of coordinate dimensions (1D, 2D, 3D, etc.)
    min_values (List[float]): List of minimum values for each dimension
    max_values (List[float]): List of maximum values for each dimension
    coordinate_count (int): Number of coordinate points to generate
    salt (str, optional): Random number salt value for increased randomness. Defaults to "".

Returns:
    str: JSON string containing random coordinates, formatted as:
    {
        "requestId": "Generated request ID",
        "coordinates": [
            [x1, y1, z1, ...],  # First point coordinates
            [x2, y2, z2, ...],  # Second point coordinates
            ...
        ]
    }

Application Scenarios:
1. Game object positioning (NPC locations, item distribution)
2. Particle systems (effect generation, particle distribution)
3. Map generation (terrain height, resource distribution)
4. Spatial sampling (3D modeling, spatial analysis)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coordinate_countYes
dimensionsYes
max_valuesYes
min_valuesYes
saltNo

Implementation Reference

  • main.py:266-298 (handler)
    The handler function for the 'generate_coordinate' tool, decorated with @mcp.tool() for registration. It defines the input parameters, documentation, and delegates execution to the coordinate_generator helper in utils.py.
    @mcp.tool()
    async def generate_coordinate(dimensions: int, min_values: List[float], max_values: List[float], 
                                coordinate_count: int, salt: str = "") -> str:
        """Random Coordinate Generator
    
        Generate random coordinate points in a specified dimensional space, each dimension has its own value range.
        Supports coordinate generation in any number of dimensions.
    
        Args:
            dimensions (int): Number of coordinate dimensions (1D, 2D, 3D, etc.)
            min_values (List[float]): List of minimum values for each dimension
            max_values (List[float]): List of maximum values for each dimension
            coordinate_count (int): Number of coordinate points to generate
            salt (str, optional): Random number salt value for increased randomness. Defaults to "".
    
        Returns:
            str: JSON string containing random coordinates, formatted as:
            {
                "requestId": "Generated request ID",
                "coordinates": [
                    [x1, y1, z1, ...],  # First point coordinates
                    [x2, y2, z2, ...],  # Second point coordinates
                    ...
                ]
            }
    
        Application Scenarios:
        1. Game object positioning (NPC locations, item distribution)
        2. Particle systems (effect generation, particle distribution)
        3. Map generation (terrain height, resource distribution)
        4. Spatial sampling (3D modeling, spatial analysis)
        """
        return await coordinate_generator(dimensions, min_values, max_values, coordinate_count, salt)
  • The core implementation of coordinate generation. Fetches blockchain randomness, derives seed, seeds numpy RNG, and generates uniform random coordinates within specified bounds for each dimension and point.
    async def coordinate_generator(dimensions: int, min_values: List[float], max_values: List[float], coordinate_count: int, salt: str="") -> Dict:
        """
        Random coordinate generator
        
        Generate random coordinates in specified dimensional space
        
        Args:
            dimensions: Number of dimensions
            min_values: Minimum values for each dimension
            max_values: Maximum values for each dimension
            coordinate_count: Number of coordinates to generate
            salt: Optional salt value for additional randomness
            
        Returns:
            Dict containing generated coordinates
        """
        if len(min_values) != dimensions or len(max_values) != dimensions:
            raise ValueError("Dimension arrays must match specified dimensions")
        
        random_num = await get_random_str()
        if not random_num:
            return {"error": "Failed to get random number"}
        request_id = generate_request_id(random_num)
        seed = _derive_seed(request_id, salt)
        np.random.seed(seed)
        
        coordinates = []
        
        for _ in range(coordinate_count):
            point = []
            for dim in range(dimensions):
                point.append(float(np.random.uniform(min_values[dim], max_values[dim])))
            coordinates.append(point)
        
        result = {
            "requestId": request_id,
            "coordinates": coordinates
        }
        
        return result
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by explaining the random generation behavior, optional salt parameter for increased randomness, and the JSON return format. It doesn't mention performance characteristics, rate limits, or error conditions, but provides substantial behavioral context beyond basic functionality.

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 clear sections (title, description, Args, Returns, Application Scenarios) and front-loaded core functionality. While comprehensive, it could be slightly more concise by integrating the 'Args' explanations more naturally into the flow rather than as a separate labeled section.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, 0% schema description coverage, and no output schema, the description provides complete context: clear purpose, detailed parameter semantics, return format specification with JSON structure example, and practical usage scenarios. This fully compensates for the lack of structured metadata.

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?

With 0% schema description coverage, the description fully compensates by providing detailed parameter explanations in the 'Args' section. Each parameter's purpose is clearly explained (dimensions as 'Number of coordinate dimensions', min/max_values as range lists, coordinate_count as 'Number of coordinate points to generate', salt as 'Random number salt value for increased randomness').

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 as 'Generate random coordinate points in a specified dimensional space' with specific details about dimensional ranges and coordinate generation. It distinguishes itself from sibling tools like 'generate_basic_random' or 'generate_random_array' by focusing specifically on coordinate generation with dimensional constraints.

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 'Application Scenarios' section provides clear context for when to use this tool (game positioning, particle systems, map generation, spatial sampling). However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools for different random generation needs.

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/suxiongye/random-web3-mcp'

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