Skip to main content
Glama
3a3

Fujitsu Social Digital Twin MCP Server

by 3a3

create_natural_language_simulation_config

Create structured simulation configurations from natural language descriptions, interpreting user requirements as technical parameters for traffic simulation.

Instructions

Converts a natural language description into a structured simulation configuration, interpreting user requirements into technical parameters for traffic simulation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYes
ctxNo

Implementation Reference

  • The tool handler function that converts natural language descriptions into structured simulation configurations. Uses keyword matching to detect simulation type (traffic, escooter, road_pricing, generic) and extracts parameters like region, time range, scooter count, deployment strategy, pricing zone, and price model.
    @mcp.tool()
    async def create_natural_language_simulation_config(description: str, ctx: Optional[Context] = None) -> Dict[str, Any]:
        """Converts a natural language description into a structured simulation configuration, 
        interpreting user requirements into technical parameters for traffic simulation."""
        try:
            if not description:
                return format_api_error(400, "Description required")
            
            config = {
                "simulationType": "unknown",
                "parameters": {}
            }
            
            description_lower = description.lower()
            
            if any(keyword in description_lower for keyword in ["traffic", "congestion", "road", "signal"]):
                config["simulationType"] = "traffic"
                
                regions = ["Tokyo", "Osaka", "Nagoya", "Fukuoka", "Sapporo", "Sendai", "Hiroshima", "Kyoto"]
                for region in regions:
                    if region.lower() in description_lower:
                        config["parameters"]["region"] = region
                        break
                
                if "morning" in description_lower or "rush hour" in description_lower:
                    config["parameters"]["timeRange"] = "morning_rush"
                elif "evening" in description_lower:
                    config["parameters"]["timeRange"] = "evening_rush"
                elif "daytime" in description_lower:
                    config["parameters"]["timeRange"] = "daytime"
                
            elif any(keyword in description_lower for keyword in ["scooter", "e-scooter", "electric"]):
                config["simulationType"] = "escooter"
                
                count_match = re.search(r'(\d+) scooters', description)
                if count_match:
                    config["parameters"]["scooterCount"] = int(count_match.group(1))
                
                if "demand" in description_lower:
                    config["parameters"]["deploymentStrategy"] = "demand_based"
                elif "grid" in description_lower:
                    config["parameters"]["deploymentStrategy"] = "grid_based"
                elif "transit" in description_lower:
                    config["parameters"]["deploymentStrategy"] = "transit_focused"
                
            elif any(keyword in description_lower for keyword in ["pricing", "toll", "congestion charge"]):
                config["simulationType"] = "road_pricing"
                
                if "city center" in description_lower:
                    config["parameters"]["pricingZone"] = "city_center"
                elif "wider area" in description_lower:
                    config["parameters"]["pricingZone"] = "wider_area"
                elif "major roads" in description_lower:
                    config["parameters"]["pricingZone"] = "major_roads"
                
                if "fixed" in description_lower:
                    config["parameters"]["priceModel"] = "fixed"
                elif "time variable" in description_lower:
                    config["parameters"]["priceModel"] = "time_variable"
                elif "congestion" in description_lower:
                    config["parameters"]["priceModel"] = "congestion_variable"
                
            else:
                config["simulationType"] = "generic"
                config["parameters"]["description"] = description
            
            current_time = datetime.now().strftime("%Y%m%d_%H%M%S")
            config["name"] = f"{config['simulationType']}_{current_time}"
            
            return config
        except Exception as e:
            logger.error(f"Config generation error: {e}")
            return format_api_error(500, str(e))
  • The tool is registered with the MCP server using @mcp.tool() decorator on line 608, which is how FastMCP discovers and exposes the tool.
    @mcp.tool()
  • The input schema is defined by the function signature: takes a 'description' (str) parameter and optional 'ctx' (Context). Returns Dict[str, Any]. The docstring describes the purpose.
    """Converts a natural language description into a structured simulation configuration, 
    interpreting user requirements into technical parameters for traffic simulation."""
  • The format_api_error helper function used by the tool to return structured error responses.
    def format_api_error(status_code: int, error_detail: str) -> Dict[str, Any]:
        return {
            "success": False,
            "status_code": status_code,
            "error": error_detail
        }
  • The FastMCP server instance ('fujitsu-digital-rehearsal') that registers the tool via the @mcp.tool() decorator.
    mcp = FastMCP("fujitsu-digital-rehearsal")
Behavior2/5

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

No annotations provided; description only says 'converts' and 'interprets' without disclosing side effects, persistence, or error handling.

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?

Single sentence that front-loads the purpose with no fluff, though it could be slightly more compact.

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

Completeness2/5

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

Does not describe return value or output format; with no output schema and many sibling tools, more context is needed for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage, and the tool description adds no detail about what the 'description' string should contain or the role of 'ctx'.

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?

Description clearly states it converts natural language to structured simulation config, distinguishing from sibling tools that might use different input formats.

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?

No guidance on when to use this tool vs alternatives like create_simulation_from_usecase, nor any prerequisites or exclusions.

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/3a3/fujitsu-sdt-mcp'

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