Skip to main content
Glama

orchestrate_dapp

Scaffold a template-based dApp monorepo with starter components including smart contracts, backend, frontend, indexer, and oracle for the Arbitrum ecosystem.

Instructions

Scaffold a template-based dApp monorepo with starter components (contract, backend, frontend, indexer, oracle).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescription of the dApp to generate
componentsNoComponents to generate (default: contract, backend, frontend)
networkNoTarget networkarbitrumSepolia
backend_frameworkNoBackend framework to usenestjs
contract_typeNoType of smart contractcustom
include_testsNoInclude test files for all components

Implementation Reference

  • The execute method of OrchestrateDappTool implements the logic for orchestrating the generation of a dApp, including generating contracts, backend, frontend, indexer, and oracle components, and injecting the ABI.
    def execute(self, **kwargs) -> dict[str, Any]:
        """Generate a complete dApp with the specified components."""
        prompt = kwargs.get("prompt", "")
        components = kwargs.get("components", ["contract", "backend", "frontend"])
        network = kwargs.get("network", "arbitrumSepolia")
        backend_framework = kwargs.get("backend_framework", "nestjs")
        include_tests = kwargs.get("include_tests", False)
        contract_type = kwargs.get("contract_type", "custom")
    
        # Validate inputs
        if not prompt:
            return {"error": "prompt is required"}
    
        # Context retrieval (template-based generation doesn't require RAG)
        context = []
    
        # Generate project structure
        project = {
            "name": self._generate_project_name(prompt),
            "description": prompt,
            "network": network,
            "components": {},
            "shared_config": self._generate_shared_config(network),
            "monorepo_structure": self._generate_monorepo_structure(components),
            "setup_instructions": [],
        }
    
        # Extract ABI from contract for injection into backend/frontend
        abi_json = []
        abi_human_readable = []
    
        # Generate each component
        if "contract" in components:
            project["components"]["contract"] = self._generate_contract(
                prompt, contract_type, include_tests
            )
            project["setup_instructions"].append("1. Run ./setup.sh to install dependencies")
    
            # Extract ABI from contract lib.rs
            lib_rs = project["components"]["contract"]["files"].get("src/lib.rs", "")
            if lib_rs:
                abi_json = extract_abi_from_code(lib_rs)
                abi_human_readable = abi_to_viem_human_readable(abi_json)
                project["components"]["contract"]["abi"] = abi_json
                project["components"]["contract"]["abi_human_readable"] = abi_human_readable
    
        if "backend" in components:
            project["components"]["backend"] = self._generate_backend(
                prompt, backend_framework, include_tests, abi_json, abi_human_readable
            )
            project["setup_instructions"].append("2. Run ./deploy.sh to build and deploy the contract")
    
        if "frontend" in components:
            project["components"]["frontend"] = self._generate_frontend(
                prompt, include_tests, abi_human_readable
            )
            project["setup_instructions"].append("3. Run ./start.sh to launch backend + frontend")
    
        if "indexer" in components:
            project["components"]["indexer"] = self._generate_indexer(
                prompt, network, abi_json=abi_json, abi_human_readable=abi_human_readable
            )
            project["setup_instructions"].append("4. Deploy the subgraph to index contract events")
    
        if "oracle" in components:
            project["components"]["oracle"] = self._generate_oracle(
                prompt, network, abi_json=abi_json
            )
            project["setup_instructions"].append("5. Set up Chainlink oracle integration")
    
        # Generate root configuration files (includes scripts)
        project["root_files"] = self._generate_root_files(
            project, components, network, backend_framework
        )
    
        # Add development workflow
        project["development_workflow"] = self._generate_dev_workflow(components)
    
        if context:
            project["references"] = [
                {
                    "source": c.get("metadata", {}).get("source", "Unknown"),
                    "relevance": c.get("distance", 0),
                }
                for c in context[:5]
            ]
    
        project["disclaimer"] = TEMPLATE_DISCLAIMER
        return project
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It states the tool scaffolds a monorepo but doesn't disclose what 'scaffold' entails (e.g., file creation, directory structure, dependencies), whether it overwrites existing files, requires specific permissions, or handles errors. This leaves significant gaps for a complex generation tool.

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 a single, efficient sentence that front-loads the core purpose without unnecessary words. Every element (verb, resource, components) earns its place, making it easy to parse quickly.

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 complex tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It lacks details on what the tool returns (e.g., file paths, success status), behavioral traits like idempotency or side effects, and integration with sibling tools. This leaves the agent with incomplete operational context.

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%, providing clear documentation for all 6 parameters. The description adds no parameter-specific information beyond implying components are generated, which is already covered by the schema. Baseline 3 is appropriate since the schema does the heavy lifting.

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 specific action ('scaffold') and resource ('template-based dApp monorepo'), listing the exact starter components (contract, backend, frontend, indexer, oracle). It distinguishes this tool from siblings like generate_backend or generate_frontend by indicating it creates a complete monorepo with multiple components rather than individual parts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for generating a full-stack dApp from templates, but provides no explicit guidance on when to use this tool versus alternatives like generate_backend or generate_frontend for individual components, or orchestrate_orbit for Orbit-specific setups. There's no mention of 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/Quantum3-Labs/ARBuilder'

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