Skip to main content
Glama
dmarsters

Constellation Composition MCP Server

by dmarsters

Generate Image Prompt from Attractor Coordinates (Phase 2.7)

generate_constellation_attractor_prompt
Read-onlyIdempotent

Convert 5D constellation coordinates into image-generation prompts for Stable Diffusion, ComfyUI, DALL-E, or Midjourney using three output modes.

Instructions

Generate image-generation-ready prompts from 5D constellation coordinates.

Layer 2: Deterministic vocabulary extraction (0 tokens).

Translates abstract parameter coordinates into concrete visual vocabulary suitable for Stable Diffusion, ComfyUI, DALL-E, or Midjourney. Three output modes are available:

  • composite: Single prompt string combining keywords and geometric specs. Best for direct image generation.

  • split_keywords: Categorized keyword lists (visual type, specifications, parameter descriptors). Best for ComfyUI prompt engineering.

  • descriptive: Narrative paragraph prompt. Best for DALL-E / Midjourney.

Coordinates can be provided directly, or derived from a canonical state name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYesInput for generating image-generation prompts from attractor coordinates.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function 'generate_constellation_attractor_prompt' which takes AttractorPromptInput to generate image prompts. It uses visual vocabulary types and parameter coordinates.
    async def generate_constellation_attractor_prompt(params: AttractorPromptInput) -> str:
        """
        Generate image-generation-ready prompts from 5D constellation coordinates.
    
        Layer 2: Deterministic vocabulary extraction (0 tokens).
    
        Translates abstract parameter coordinates into concrete visual vocabulary
        suitable for Stable Diffusion, ComfyUI, DALL-E, or Midjourney. Three
        output modes are available:
    
        - **composite**: Single prompt string combining keywords and geometric specs.
          Best for direct image generation.
        - **split_keywords**: Categorized keyword lists (visual type, specifications,
          parameter descriptors). Best for ComfyUI prompt engineering.
        - **descriptive**: Narrative paragraph prompt. Best for DALL-E / Midjourney.
    
        Coordinates can be provided directly, or derived from a canonical state name.
        """
        # Resolve coordinates
        if params.coordinates:
            coords = params.coordinates
            # Fill missing params with 0.5 default
            for p in CONSTELLATION_PARAMETER_NAMES:
                if p not in coords:
                    coords[p] = 0.5
        elif params.canonical_state:
            state = CONSTELLATION_CANONICAL_STATES[params.canonical_state]
            coords = {p: state[p] for p in CONSTELLATION_PARAMETER_NAMES}
        else:
            return json.dumps({
                "error": "Provide either 'coordinates' dict or 'canonical_state' name"
            })
    
        vocab = _extract_visual_vocabulary(coords, params.strength)
    
        if params.mode == "composite":
            prompt = _generate_composite_prompt(coords, params.strength)
            return json.dumps({
                "mode": "composite",
                "prompt": prompt,
                "nearest_visual_type": vocab["nearest_type"],
                "type_distance": vocab["distance"],
                "coordinates": coords
            }, indent=2)
    
        elif params.mode == "split_keywords":
            # Build categorized keyword sets
            specs = {}
            sd = coords.get("stellar_density", 0.5)
            specs["density"] = (
                "dense rich starfield" if sd > 0.7
                else "sparse isolated stars" if sd < 0.3
                else "moderate star density"
            )
            gr = coords.get("geometric_regularity", 0.5)
            specs["geometry"] = (
                "precise geometric arrangement" if gr > 0.7
                else "organic flowing forms" if gr < 0.3
                else "naturally balanced arrangement"
            )
            lc = coords.get("luminance_contrast", 0.5)
            specs["luminance"] = (
                "extreme brightness contrast" if lc > 0.7
                else "soft even luminosity" if lc < 0.3
                else "moderate contrast"
            )
            ni = coords.get("narrative_intensity", 0.5)
            specs["mood"] = (
                "dramatic mythological atmosphere" if ni > 0.7
                else "contemplative quiet mood" if ni < 0.3
                else "balanced narrative tone"
            )
            se = coords.get("spatial_extent", 0.5)
            specs["scale"] = (
                "wide panoramic field" if se > 0.7
                else "intimate compact framing" if se < 0.3
                else "moderate field of view"
            )
    
            return json.dumps({
                "mode": "split_keywords",
                "visual_type_keywords": vocab["keywords"],
                "parameter_descriptors": specs,
                "nearest_visual_type": vocab["nearest_type"],
                "type_distance": vocab["distance"],
                "coordinates": coords
            }, indent=2)
    
        else:  # descriptive
            prompt = _generate_descriptive_prompt(coords, params.strength)
            return json.dumps({
                "mode": "descriptive",
                "prompt": prompt,
                "nearest_visual_type": vocab["nearest_type"],
                "type_distance": vocab["distance"],
                "coordinates": coords
            }, indent=2)
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false, covering safety and idempotency. The description adds valuable context beyond this: it explains the tool's role as 'Layer 2: Deterministic vocabulary extraction (0 tokens)' and mentions that coordinates can be 'derived from a canonical state name.' This provides insight into the tool's deterministic nature and input flexibility, though it doesn't detail rate limits or authentication needs.

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 front-loaded: the first sentence states the core purpose, followed by layers, translation details, and output modes. Every sentence adds value—explaining the tool's phase, output formats, and input options—with zero wasted words. It's appropriately sized for the tool's complexity.

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 the presence of an output schema, the description is complete enough. It covers purpose, usage context, behavioral traits, and parameter semantics without needing to explain return values (handled by output schema). No significant gaps remain for agent understanding.

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 fully documents all parameters (coordinates, canonical_state, mode, strength). The description adds some semantic context by mentioning '5D parameter coordinates' and listing the three output modes with brief explanations, but this largely repeats or paraphrases what's in the schema. No additional parameter details beyond the schema are provided.

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: 'Generate image-generation-ready prompts from 5D constellation coordinates.' It specifies the verb ('Generate'), resource ('prompts'), and source ('5D constellation coordinates'), distinguishing it from siblings like 'generate_constellation_composition' or 'get_constellation_visual_types' which handle different aspects of the constellation system.

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 when to use this tool: 'Translates abstract parameter coordinates into concrete visual vocabulary suitable for Stable Diffusion, ComfyUI, DALL-E, or Midjourney.' It also explains the three output modes and their best-use cases (e.g., 'composite' for direct image generation). However, it doesn't explicitly state when NOT to use it or name specific alternatives among sibling tools.

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