Skip to main content
Glama
dmarsters

Constellation Composition MCP Server

by dmarsters

Generate Composition Parameters from Constellation

generate_constellation_composition
Read-onlyIdempotent

Generate image composition parameters by translating constellation star patterns into focal points, visual flow, balance, and mythological themes for consistent AI image generation.

Instructions

Generate detailed composition parameters mapped from a constellation's geometry and mythology.

Translates astronomical star patterns into practical compositional guidance for image generation, including focal point placement, visual flow, balance characteristics, and thematic elements derived from constellation mythology.

This uses a deterministic zero-LLM-cost approach for geometric translation, making it highly efficient for batch processing and consistent results.

Args: params (ConstellationCompositionInput): Configuration including: - constellation_name: Name or abbreviation of constellation - canvas_width: Target canvas width in pixels (512-4096) - canvas_height: Target canvas height in pixels (512-4096) - include_mythology: Include mythological themes (boolean) - response_format: Output format (json or markdown)

Returns: str: Structured composition parameters in requested format, including: - focal_points: List of primary visual anchors with positions and weights - visual_flow: Directional movement and rhythm patterns - balance: Visual balance type and center of mass - spatial_distribution: How elements spread across frame - mythology_themes: Key thematic elements from constellation story - suggested_elements: Concrete suggestions for subjects, lighting, atmosphere, colors

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYesInput for generating composition from constellation.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'generate_constellation_composition' tool handler function. It validates the constellation input, optionally fetches geometry data, performs the core deterministic composition mapping, and formats the output.
    async def generate_constellation_composition(params: ConstellationCompositionInput) -> str:
        """
        Generate detailed composition parameters mapped from a constellation's geometry and mythology.
        
        Translates astronomical star patterns into practical compositional guidance for image
        generation, including focal point placement, visual flow, balance characteristics,
        and thematic elements derived from constellation mythology.
        
        This uses a deterministic zero-LLM-cost approach for geometric translation,
        making it highly efficient for batch processing and consistent results.
        
        Args:
            params (ConstellationCompositionInput): Configuration including:
                - constellation_name: Name or abbreviation of constellation
                - canvas_width: Target canvas width in pixels (512-4096)
                - canvas_height: Target canvas height in pixels (512-4096)
                - include_mythology: Include mythological themes (boolean)
                - response_format: Output format (json or markdown)
        
        Returns:
            str: Structured composition parameters in requested format, including:
                - focal_points: List of primary visual anchors with positions and weights
                - visual_flow: Directional movement and rhythm patterns
                - balance: Visual balance type and center of mass
                - spatial_distribution: How elements spread across frame
                - mythology_themes: Key thematic elements from constellation story
                - suggested_elements: Concrete suggestions for subjects, lighting, atmosphere, colors
        """
        
        # Find constellation in database
        constellation_name = params.constellation_name
        if constellation_name not in CONSTELLATIONS:
            available = ', '.join(sorted(CONSTELLATIONS.keys()))
            return f"Error: Constellation '{constellation_name}' not found. Available constellations: {available}"
        
        metadata = CONSTELLATIONS[constellation_name]
        abbr = metadata['abbr']
        
        # Attempt to fetch real geometry data (optional enhancement)
        geometry_data = await fetch_constellation_data(abbr)
        
        # Generate composition parameters (deterministic, zero-LLM-cost)
        composition = map_constellation_to_composition(
            constellation_name=constellation_name,
            metadata=metadata,
            geometry_data=geometry_data,
            canvas_width=params.canvas_width,
            canvas_height=params.canvas_height,
            include_mythology=params.include_mythology
        )
        
        # Format response
        if params.response_format == ResponseFormat.JSON:
            result = {
                'constellation': constellation_name,
                'abbreviation': abbr,
                'canvas': {
                    'width': params.canvas_width,
                    'height': params.canvas_height
                },
                'composition': composition.model_dump()
            }
            return json.dumps(result, indent=2)
        else:
            return format_composition_markdown(constellation_name, metadata, composition)
Behavior4/5

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

Annotations provide readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false. The description adds valuable behavioral context beyond annotations: 'deterministic zero-LLM-cost approach' (efficiency and consistency), 'highly efficient for batch processing' (performance characteristics), and 'geometric translation' (methodology). It doesn't contradict annotations and provides useful implementation details.

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: purpose statement, methodology note, Args, and Returns. It's appropriately sized for the tool's complexity. However, the Args section could be more concise since it largely repeats schema information, and the methodology note could be integrated more seamlessly.

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?

Given the tool's moderate complexity, rich annotations (readOnly, idempotent, etc.), 100% schema coverage, and detailed output schema in the Returns section, the description provides complete context. It explains what the tool does, how it works (deterministic geometric translation), what inputs it expects, and what outputs it produces, leaving no significant gaps for an AI agent.

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 100%, so the schema already documents all parameters thoroughly. The description's Args section restates parameter names but adds minimal semantic value beyond the schema. It does clarify that 'include_mythology' affects 'mythological themes' and 'response_format' controls output structure, but this is largely redundant with schema 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: 'Translates astronomical star patterns into practical compositional guidance for image generation.' It specifies the verb ('translates') and resource ('astronomical star patterns') while distinguishing from siblings like 'get_constellation_coordinates' (raw data) or 'apply_constellation_preset' (applying existing presets).

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 description provides clear context: 'for image generation' and 'consistent results for batch processing.' It implies when to use this tool (needing composition guidance from constellations) but doesn't explicitly contrast with alternatives like 'generate_constellation_attractor_prompt' (which might focus on prompts rather than composition parameters) or 'apply_constellation_preset' (which applies existing presets rather than generating new ones).

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/dmarsters/constellation-composition-mcp'

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