Skip to main content
Glama

get_priority_fee

get_priority_fee

Fetch a suggested priority fee to include transactions in the next VeChain mainnet blocks, helping users optimize transaction inclusion timing.

Instructions

Fetch a suggested priority fee for including a transaction in the next blocks from VeChain mainnet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function (callback) that fetches the suggested priority fee from the VeChain Thorest API endpoint `/fees/priority`. Handles fetch, error cases, and timeout.
    callback: async () => {
        const base = isMainnet ? vechainConfig.mainnet.thorestApiBaseUrl : vechainConfig.testnet.thorestApiBaseUrl;
        const url = `${base}/fees/priority`;
    
        const controller = new AbortController();
        const timeout = setTimeout(() => controller.abort(), isMainnet ? vechainConfig.mainnet.controllerAbortTimeout : vechainConfig.testnet.controllerAbortTimeout);
    
        try {
            const res = await fetch(url, { signal: controller.signal });
    
            if (!res.ok) {
                const bodyText = await res.text().catch(() => "");
                throw new Error(
                    `VeChain node responded ${res.status} ${res.statusText}${bodyText ? `: ${bodyText}` : ""
                    }`
                );
            }
    
            const data = await res.json();
    
            return {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify(data, null, 2),
                    },
                ],
            };
        } catch (err) {
            const isAbort = (err as Error)?.name === "AbortError";
            return {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify(
                            {
                                error: isAbort ? "Request timed out" : "Failed to fetch priority fee",
                                reason: String((err as Error)?.message ?? err),
                                url,
                            },
                            null,
                            2
                        ),
                    },
                ],
            };
        } finally {
            clearTimeout(timeout);
        }
    }
  • The input schema for the tool, which is empty as no parameters are required.
    inputSchema: {},
  • src/server.ts:74-92 (registration)
    Registration of the get_priority_fee tool (along with other vechainTools) to the MCP server using server.registerTool, wrapping the callback.
    for (const t of vechainTools) {
      server.registerTool(
        t.name,
        {
          title: t.name,
          description: t.description,
          inputSchema: t.inputSchema
        },
        async (args) => {
          const result = await t.callback(args);
          return {
            content: result.content.map(item => ({
              ...item,
              type: "text" as const
            }))
          };
        }
      );
    }
  • src/tools.ts:27-27 (registration)
    Export of the vechainTools array containing the tool definition, which is imported and used for registration.
    export const vechainTools: VeChainTool[] = [
  • Full tool object definition including name, title, description, schema, and handler callback.
        name: "get_priority_fee",
        title: "Suggest a priority fee",
        description: "Fetch a suggested priority fee for including a transaction in the next blocks from VeChain mainnet.",
        inputSchema: {},
        callback: async () => {
            const base = isMainnet ? vechainConfig.mainnet.thorestApiBaseUrl : vechainConfig.testnet.thorestApiBaseUrl;
            const url = `${base}/fees/priority`;
    
            const controller = new AbortController();
            const timeout = setTimeout(() => controller.abort(), isMainnet ? vechainConfig.mainnet.controllerAbortTimeout : vechainConfig.testnet.controllerAbortTimeout);
    
            try {
                const res = await fetch(url, { signal: controller.signal });
    
                if (!res.ok) {
                    const bodyText = await res.text().catch(() => "");
                    throw new Error(
                        `VeChain node responded ${res.status} ${res.statusText}${bodyText ? `: ${bodyText}` : ""
                        }`
                    );
                }
    
                const data = await res.json();
    
                return {
                    content: [
                        {
                            type: "text",
                            text: JSON.stringify(data, null, 2),
                        },
                    ],
                };
            } catch (err) {
                const isAbort = (err as Error)?.name === "AbortError";
                return {
                    content: [
                        {
                            type: "text",
                            text: JSON.stringify(
                                {
                                    error: isAbort ? "Request timed out" : "Failed to fetch priority fee",
                                    reason: String((err as Error)?.message ?? err),
                                    url,
                                },
                                null,
                                2
                            ),
                        },
                    ],
                };
            } finally {
                clearTimeout(timeout);
            }
        }
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool fetches a 'suggested' fee, implying it's informational/read-only, but doesn't clarify if it's real-time, cached, requires authentication, has rate limits, or what happens on errors. This leaves significant gaps for a tool interacting with a blockchain network.

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 directly states the tool's function without unnecessary words. It's front-loaded with the core action ('Fetch a suggested priority fee') and efficiently adds context ('for including a transaction in the next blocks from VeChain mainnet'). Every part earns its place.

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

Completeness3/5

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

Given the tool has 0 parameters, no annotations, and no output schema, the description is minimally adequate but lacks depth. It explains what the tool does but not how it behaves (e.g., response format, error handling, network dependencies). For a blockchain fee tool, more context on reliability or data freshness would improve completeness.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing instead on the tool's purpose. A baseline of 4 is applied as it efficiently handles the zero-parameter case without redundancy.

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 action ('Fetch') and the resource ('suggested priority fee'), specifying it's for VeChain mainnet transactions. However, it doesn't explicitly differentiate from sibling tools like 'get_transaction' or 'get_block', which also fetch blockchain data but for different resources.

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 minimal context ('for including a transaction in the next blocks'), but offers no explicit guidance on when to use this tool versus alternatives (e.g., other fee estimation tools or sibling tools like 'get_transaction'). There's no mention of prerequisites, timing, 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/leandrogavidia/vechain-mcp-server'

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