Skip to main content
Glama

get_funding_current

Read-onlyIdempotent

Retrieve the current funding rate, premium, and timestamp for a specified coin on Hyperliquid.

Instructions

Get the current Hyperliquid funding rate for a coin. Returns the latest funding rate, premium, and timestamp.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesCoin/market symbol, e.g. 'BTC', 'ETH', 'SOL'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesResult data object

Implementation Reference

  • src/index.ts:518-525 (registration)
    Registration of the 'get_funding_current' tool using the registerCurrentTool helper pattern. It calls api().hyperliquid.funding.current(coin) with a CoinParam schema and normalizeHLCoin normalization.
    // 6. Funding Current
    registerCurrentTool(
      "get_funding_current",
      "Get the current Hyperliquid funding rate for a coin. Returns the latest funding rate, premium, and timestamp.",
      (coin) => api().hyperliquid.funding.current(coin),
      CoinParam,
      normalizeHLCoin
    );
  • The 'registerCurrentTool' helper function that defines the handler pattern for current-snapshot tools like get_funding_current. It takes an SDK call function, validates the coin parameter, normalizes it, calls the SDK, and formats the response.
    function registerCurrentTool(
      name: string,
      description: string,
      sdkCall: (coin: string) => Promise<unknown>,
      coinSchema: z.ZodString,
      normFn: (coin: string) => string
    ): void {
      registerTool(name, description, { coin: coinSchema }, ObjectOutputSchema, async (params) => {
        const data = await sdkCall(normFn(params.coin));
        return formatResponse(data);
      });
    }
  • The core 'registerTool' function that wraps every tool with API key validation (returns MISSING_KEY_MESSAGE if no client), error handling (catches and formats OxArchiveError), and registers the tool on the MCP server with annotations.
    function registerTool(
      name: string,
      description: string,
      inputSchema: ZodRawShape,
      outputSchema: ZodRawShape,
      handler: (params: any) => Promise<McpContent>
    ): void {
      server.registerTool(
        name,
        {
          description,
          inputSchema,
          outputSchema,
          annotations: TOOL_ANNOTATIONS,
        },
        async (params: any) => {
          if (!client) {
            return {
              content: [{ type: "text" as const, text: MISSING_KEY_MESSAGE }],
              isError: true,
            };
          }
          try {
            return await handler(params);
          } catch (err) {
            const error = err instanceof OxArchiveError ? err : new OxArchiveError(String(err), 500);
            return formatError(error);
          }
        }
      );
    }
  • The CoinParam schema used by get_funding_current for the 'coin' input parameter. Accepts a string describing a coin/market symbol like 'BTC', 'ETH', 'SOL'.
    const CoinParam = z
      .string()
      .describe("Coin/market symbol, e.g. 'BTC', 'ETH', 'SOL'");
  • The ObjectOutputSchema used as the output schema for get_funding_current. Wraps the result data in a single 'data' object.
    // For tools that return a single object (current snapshots, orderbooks, data quality)
    const ObjectOutputSchema: ZodRawShape = {
      data: z.record(z.unknown()).describe("Result data object"),
    };
Behavior4/5

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

Annotations already provide readOnlyHint, idempotentHint, etc. The description adds that it returns the latest funding rate, premium, and timestamp, providing context beyond annotations. Could mention edge cases like missing coin data.

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?

Single sentence with no filler. Front-loaded and efficient.

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

Completeness4/5

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

Given that an output schema exists, detailed return value explanation is not required. The description covers the essential return fields. For a one-parameter tool, it is sufficiently complete.

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 coverage is 100% with a clear description of the 'coin' parameter. The description does not add extra meaning beyond what the schema provides, so it meets the baseline.

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?

Clearly states it gets the current funding rate for a coin, specifying the three return fields. However, does not differentiate from sibling tools like get_hip3_funding_current or get_lighter_funding_current, which have similar purposes.

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 versus alternatives such as get_funding_history or variants. The description implies usage for current data but lacks explicit context 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/0xArchiveIO/0xarchive-mcp'

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