Skip to main content
Glama

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); } } },

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