Skip to main content
Glama

generate_orbit_config

Create configuration code for Orbit chain deployments, including chain setup, AnyTrust DAC configuration, and custom gas token settings using the Arbitrum Orbit SDK.

Instructions

Generate configuration code for Orbit chain deployment. Supports chain config, AnyTrust DAC setup, and custom gas token configuration using @arbitrum/orbit-sdk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescription of the configuration needed
chain_idNoChain ID for the new Orbit chain
ownerNoInitial chain owner address (0x...)
is_anytrustNoWhether this is an AnyTrust chain (vs Rollup)
native_tokenNoCustom gas token address (ERC20)
parent_chainNoParent chain for the Orbit chainarbitrum-sepolia

Implementation Reference

  • The `execute` method in `GenerateOrbitConfigTool` handles the logic for generating Orbit chain configurations by selecting templates and replacing placeholders with provided parameters.
    def execute(self, **kwargs) -> dict[str, Any]:
        """Generate Orbit chain configuration code."""
        prompt = kwargs.get("prompt", "")
        chain_id = kwargs.get("chain_id", 412346)
        owner = kwargs.get("owner", "0x0000000000000000000000000000000000000000")
        is_anytrust = kwargs.get("is_anytrust", False)
        native_token = kwargs.get("native_token")
        parent_chain = kwargs.get("parent_chain", "arbitrum-sepolia")
    
        if not prompt:
            return {"error": "prompt is required"}
    
        # Select template based on prompt keywords
        lower_prompt = prompt.lower()
    
        if native_token or "gas token" in lower_prompt or "native token" in lower_prompt:
            template = get_orbit_template("custom_gas_token")
        elif is_anytrust or "anytrust" in lower_prompt or "dac" in lower_prompt:
            template = get_orbit_template("anytrust_config")
        else:
            template = get_orbit_template("chain_config")
    
        if not template:
            template = get_orbit_template("chain_config")
    
        # Get parent chain info
        parent_rpc = PARENT_CHAIN_RPCS.get(parent_chain, PARENT_CHAIN_RPCS["arbitrum-sepolia"])
        parent_chain_id = self._get_parent_chain_id(parent_chain)
        parent_chain_name = parent_chain.replace("-", " ").title()
    
        # Substitute parameters
        code = template.code
        code = code.replace("{chain_id}", str(chain_id))
        code = code.replace("{owner}", owner)
        code = code.replace("{is_anytrust}", "true" if is_anytrust else "false")
        code = code.replace("{parent_chain_id}", str(parent_chain_id))
        code = code.replace("{parent_chain_name}", parent_chain_name)
        code = code.replace("{parent_chain_rpc}", parent_rpc)
    
        if native_token:
            code = code.replace("{native_token}", native_token)
            code = code.replace(
                "{validators_array}",
                "[account.address] as `0x${string}`[]",
            )
            code = code.replace(
                "{batch_posters_array}",
                "[account.address] as `0x${string}`[]",
            )
    
        # Build files dict
        files = {}
        if template.template_type == "config" and template.name == "Orbit Chain Config":
            files["scripts/prepare-chain-config.ts"] = code
        elif "anytrust" in template.name.lower():
            files["scripts/configure-anytrust.ts"] = code
        elif "gas token" in template.name.lower():
            files["scripts/deploy-custom-gas-token.ts"] = code
        else:
            files["scripts/configure.ts"] = code
    
        # Add .env.example
        files[".env.example"] = self._generate_env_example(parent_rpc, chain_id)
    
        result = {
            "template_used": template.name,
            "template_type": template.template_type,
            "files": files,
            "dependencies": ORBIT_DEPENDENCIES,
            "parent_chain": {
                "name": parent_chain,
                "chain_id": parent_chain_id,
                "rpc": parent_rpc,
            },
            "chain_config": {
                "chain_id": chain_id,
                "owner": owner,
                "is_anytrust": is_anytrust,
                "native_token": native_token,
            },
            "setup_instructions": [
                "1. Install dependencies: npm install",
                "2. Copy .env.example to .env and fill in your private key",
                f"3. Run the script: npx tsx {list(files.keys())[0]}",
            ],
            "disclaimer": TEMPLATE_DISCLAIMER,
        }
    
        return result
  • The `input_schema` defines the required and optional parameters for the `generate_orbit_config` tool.
    input_schema = {
        "type": "object",
        "properties": {
            "prompt": {
                "type": "string",
                "description": "Description of the configuration needed",
            },
            "chain_id": {
                "type": "integer",
                "description": "Chain ID for the new Orbit chain",
                "default": 412346,
            },
            "owner": {
                "type": "string",
                "description": "Initial chain owner address (0x...)",
            },
            "is_anytrust": {
                "type": "boolean",
                "description": "Whether this is an AnyTrust chain (vs Rollup)",
                "default": False,
            },
            "native_token": {
                "type": "string",
                "description": "Custom gas token address (ERC20) for custom gas token chains",
            },
            "parent_chain": {
                "type": "string",
                "enum": [
                    "arbitrum-one",
                    "arbitrum-sepolia",
                    "ethereum-mainnet",
                    "ethereum-sepolia",
                ],
                "description": "Parent chain for the Orbit chain",
                "default": "arbitrum-sepolia",
            },
        },
        "required": ["prompt"],
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool 'supports chain config, AnyTrust DAC setup, and custom gas token configuration' but doesn't describe what the tool actually produces (code format, language, structure), whether it's a read-only generation or has side effects, or any constraints like rate limits or authentication requirements. For a code generation tool with no annotation coverage, this is insufficient.

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 appropriately concise - a single sentence that efficiently communicates the core functionality. It's front-loaded with the main purpose and includes relevant technical context (the SDK used). There's no wasted verbiage or redundancy.

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?

For a code generation tool with 6 parameters and no annotations or output schema, the description is incomplete. It doesn't explain what format the generated code takes (TypeScript? JSON? CLI commands?), what the output looks like, or any behavioral characteristics. With no output schema and no annotations, the description should provide more context about the tool's behavior and results.

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 adds minimal value beyond the schema - it mentions 'AnyTrust DAC setup' which relates to the 'is_anytrust' parameter, and 'custom gas token configuration' which relates to 'native_token', but doesn't provide additional semantic context beyond what's in the parameter descriptions. Baseline 3 is appropriate when schema does the heavy lifting.

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?

The description clearly states the tool's purpose: 'Generate configuration code for Orbit chain deployment' with specific capabilities (chain config, AnyTrust DAC setup, custom gas token). It distinguishes from siblings like 'generate_orbit_deployment' by focusing on configuration code generation rather than deployment orchestration. However, it doesn't explicitly contrast with all similar tools like 'generate_validator_setup'.

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?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools like 'generate_orbit_deployment', 'orchestrate_orbit', and 'ask_orbit', there's no indication of when configuration generation is appropriate versus deployment orchestration or general queries. The description mentions what the tool supports but not when to choose it.

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/Quantum3-Labs/ARBuilder'

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