Skip to main content
Glama

ask_bridging

Get answers about Arbitrum bridging and cross-chain messaging patterns with optional code examples for implementation guidance.

Instructions

Answer questions about Arbitrum bridging and cross-chain messaging patterns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYesQuestion about Arbitrum bridging or messaging
include_code_exampleNoInclude a code example in the answer if relevant

Implementation Reference

  • The 'execute' method of AskBridgingTool handles the core logic for answering bridging questions, using a knowledge base and optional RAG context.
    def execute(self, **kwargs) -> dict[str, Any]:
        """Answer a bridging question."""
        question = kwargs.get("question", "").strip()
        include_code = kwargs.get("include_code_example", False)
    
        if not question:
            return {"error": "Question is required and cannot be empty"}
    
        # Normalize question
        q_lower = question.lower()
    
        # Try to match against knowledge base
        answer_parts = []
        relevant_topics = []
    
        # Check for ETH-related questions
        if "eth" in q_lower and ("deposit" in q_lower or "bridge" in q_lower or "withdraw" in q_lower):
            if "withdraw" in q_lower or ("l1" in q_lower and "from l2" in q_lower):
                relevant_topics.append("eth_withdraw")
            else:
                relevant_topics.append("eth_deposit")
    
        # Check for token/ERC20 questions
        if "token" in q_lower or "erc20" in q_lower:
            if "withdraw" in q_lower:
                relevant_topics.append("erc20_withdraw")
            else:
                relevant_topics.append("erc20_deposit")
    
        # Check for retryable ticket questions
        if "retryable" in q_lower or "ticket" in q_lower:
            relevant_topics.append("retryable_tickets")
    
        # Check for messaging questions
        if "message" in q_lower or "messaging" in q_lower:
            if "l2 to l1" in q_lower or "l2->l1" in q_lower or "withdraw" in q_lower:
                relevant_topics.append("l2_to_l1_messaging")
            else:
                relevant_topics.append("l1_to_l2_messaging")
    
        # Check for L3/Orbit questions
        if "l3" in q_lower or "orbit" in q_lower:
            relevant_topics.append("l1_l3_bridging")
    
        # Check for gas token questions
        if "gas token" in q_lower or "custom gas" in q_lower:
            relevant_topics.append("custom_gas_token")
    
        # Check for timing questions
        if "how long" in q_lower or "time" in q_lower or "when" in q_lower:
            if "withdraw" in q_lower:
                relevant_topics.extend(["eth_withdraw", "l2_to_l1_messaging"])
            else:
                relevant_topics.append("eth_deposit")
    
        # Build answer from relevant topics
        if relevant_topics:
            for topic in set(relevant_topics):
                if topic in BRIDGING_KNOWLEDGE:
                    info = BRIDGING_KNOWLEDGE[topic]
                    answer_parts.append(f"## {topic.replace('_', ' ').title()}")
                    for key, value in info.items():
                        if isinstance(value, list):
                            answer_parts.append(f"**{key.replace('_', ' ').title()}:**")
                            for item in value:
                                answer_parts.append(f"  - {item}")
                        else:
                            answer_parts.append(f"**{key.replace('_', ' ').title()}:** {value}")
                    answer_parts.append("")
    
        # Try RAG context if available
        rag_context = ""
        if self.context_tool:
            try:
                # Use execute() method with custom boosting for bridging/SDK content
                ctx_result = self.context_tool.execute(
                    query=question,
                    n_results=3,
                    rerank=True,
                    category_boosts={
                        "arbitrum_docs": 1.3,    
                        "arbitrum_sdk": 1.5,    
                        "orbit_sdk": 1.0,       
                        "stylus": 0.8,          
                    },
                )
                if ctx_result.get("contexts"):
                    rag_context = "\n\n".join(
                        c.get("content", "") for c in ctx_result["contexts"][:2]
                    )
            except Exception:
                pass  # RAG is optional
    
        # Build final answer
        if answer_parts:
            answer = "\n".join(answer_parts)
        else:
            # Generic answer for unmatched questions
            answer = self._get_generic_answer(question)
    
        result = {
            "answer": answer,
            "topics": list(set(relevant_topics)) if relevant_topics else ["general"],
            "references": self._get_references(relevant_topics),
        }
    
        if include_code:
            result["code_example"] = self._get_code_example(relevant_topics)
    
        if rag_context:
            result["additional_context"] = rag_context[:1000]
    
        return result
  • Registration of the ask_bridging tool in the MCP server.
    "ask_bridging": AskBridgingTool(context_tool=self.context_tool),
  • Input schema for the ask_bridging tool.
    input_schema = {
        "type": "object",
        "properties": {
            "question": {
                "type": "string",
                "description": "Question about Arbitrum bridging or messaging",
            },
            "include_code_example": {
                "type": "boolean",
                "description": "Include a code example in the answer if relevant",
                "default": False,
            },
        },
        "required": ["question"],
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool answers questions, implying a read-only, informational operation, but doesn't disclose any behavioral traits such as response format, potential errors, rate limits, or authentication needs. This leaves significant gaps in understanding how the tool behaves beyond its basic purpose.

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 directly states the tool's purpose without any fluff or redundancy. It's front-loaded with the core function and appropriately sized, making it easy to parse and understand 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?

Given the complexity of a Q&A tool with no annotations and no output schema, the description is incomplete. It doesn't explain what kind of answers to expect, how detailed they are, or any limitations (e.g., scope of knowledge). For a tool that likely provides informational responses, more context on behavior and output would be helpful to set proper expectations.

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?

The description adds no parameter semantics beyond what the input schema provides. With 100% schema description coverage, the schema already documents both parameters ('question' and 'include_code_example') clearly. The description doesn't elaborate on parameter usage, constraints, or examples, so it meets the baseline for high schema coverage without adding extra value.

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: 'Answer questions about Arbitrum bridging and cross-chain messaging patterns.' It specifies the verb ('answer questions') and the domain/resource ('Arbitrum bridging and cross-chain messaging patterns'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'ask_orbit' or 'ask_stylus', which likely answer questions about different topics, so it misses full sibling distinction.

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. It doesn't mention sibling tools like 'ask_orbit' or 'ask_stylus' for comparison, nor does it specify prerequisites, contexts, or exclusions for usage. The agent must infer usage based on the topic alone, which is insufficient for clear decision-making.

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