Skip to main content
Glama

Get Bridge Stats

get-bridge-stats
Read-onlyIdempotent

Retrieve PulseChain bridge statistics including inflows, outflows, and net flow over the last 7 days to analyze cross-chain activity.

Instructions

Get PulseChain bridge statistics: inflows, outflows, net flow over the last 7 days.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
inflow_usdYesTotal bridge inflows in USD over the last 7 days
outflow_usdYesTotal bridge outflows in USD over the last 7 days
net_flow_usdYesNet flow (inflow - outflow) in USD
dailyYesDaily bridge flow breakdown

Implementation Reference

  • Registration of the 'get-bridge-stats' tool via server.registerTool with name, schema, and handler.
    server.registerTool(
      'get-bridge-stats',
      {
        title: 'Get Bridge Stats',
        description: 'Get PulseChain bridge statistics: inflows, outflows, net flow over the last 7 days.',
        outputSchema: z.object({
          inflow_usd: z.number().describe('Total bridge inflows in USD over the last 7 days'),
          outflow_usd: z.number().describe('Total bridge outflows in USD over the last 7 days'),
          net_flow_usd: z.number().describe('Net flow (inflow - outflow) in USD'),
          daily: z.array(z.object({
            date: z.string().describe('Date in ISO format'),
            inflow_usd: z.number().describe('Daily inflow in USD'),
            outflow_usd: z.number().describe('Daily outflow in USD'),
          }).passthrough()).describe('Daily bridge flow breakdown'),
        }).passthrough(),
        annotations: READ_ONLY_ANNOTATIONS,
      },
      async () => {
        const data = await fetchJSON(`${SAFETY}/api/v1/bridge/stats`)
        return wrapResult(data)
      }
    )
  • Output schema defining the response shape: inflow_usd, outflow_usd, net_flow_usd, and daily array of date/inflow/outflow.
    outputSchema: z.object({
      inflow_usd: z.number().describe('Total bridge inflows in USD over the last 7 days'),
      outflow_usd: z.number().describe('Total bridge outflows in USD over the last 7 days'),
      net_flow_usd: z.number().describe('Net flow (inflow - outflow) in USD'),
      daily: z.array(z.object({
        date: z.string().describe('Date in ISO format'),
        inflow_usd: z.number().describe('Daily inflow in USD'),
        outflow_usd: z.number().describe('Daily outflow in USD'),
      }).passthrough()).describe('Daily bridge flow breakdown'),
    }).passthrough(),
  • Handler function that fetches bridge stats from the safety API endpoint and wraps the result.
    async () => {
      const data = await fetchJSON(`${SAFETY}/api/v1/bridge/stats`)
      return wrapResult(data)
    }
  • fetchJSON helper used by the handler to make HTTP requests with auth and timeout.
    async function fetchJSON(url: string): Promise<any> {
      const headers: Record<string, string> = { 'Accept': 'application/json' }
      if (HAS_API_KEY) headers['Authorization'] = `Bearer ${API_KEY}`
      const controller = new AbortController()
      const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS)
      try {
        const res = await fetch(url, { headers, signal: controller.signal })
        if (!res.ok) {
          if (res.status === 401 || res.status === 403) {
            throw new Error(
              `API ${res.status}: This endpoint requires a valid API key. ` +
              `Get one at ${PRICING_URL}`
            )
          }
          throw new Error(`API request failed with status ${res.status}`)
        }
        return res.json()
      } finally {
        clearTimeout(timer)
      }
Behavior4/5

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

Annotations already declare readOnly, idempotent, nondestructive, and open world hints. The description adds the 7-day time window context, which is not covered by annotations, enhancing transparency without contradiction.

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, well-structured sentence that front-loads the key information (what it does and the metric details) without any extraneous words.

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 simplicity (no parameters, has output schema), the description fully covers the scope, specifying the metrics and time window. The output schema handles return value details.

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

Parameters4/5

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

The tool has zero parameters and schema coverage is 100%, so the description is not required to explain parameters. Baseline 4 is appropriate as no additional parameter info is needed.

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 it retrieves PulseChain bridge statistics, specifying inflows, outflows, net flow, and a precise time range ('last 7 days'), which uniquely identifies its purpose among sibling tools.

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?

While no explicit 'when to use' guidance is given, the description clearly implies usage for bridge statistics, and there are no sibling tools covering bridge data, so confusion is minimal.

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/openpulsechain/public'

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