Skip to main content
Glama

agentek-eth

by NaniDAO
tools.ts1.18 kB
import { z } from "zod"; import { createTool } from "../client.js"; import type { AgentekClient } from "../client.js"; import { clean } from "../utils.js"; const getFearAndGreedIndexToolParams = z.object({}); export type GetFearAndGreedIndexToolReturnType = { value: string; }; export const fearGreedIndexTool = createTool({ name: "getFearAndGreedIndex", description: "Retrieves the current Fear and Greed Index value from Alternative.me API.", parameters: getFearAndGreedIndexToolParams, execute: async ( _client: AgentekClient, _args: z.infer<typeof getFearAndGreedIndexToolParams>, ): Promise<GetFearAndGreedIndexToolReturnType> => { try { const response = await fetch("https://api.alternative.me/fng/"); const data = await response.json(); if ( !data || !data.data || !Array.isArray(data.data) || !data.data[0] || !data.data[0].value ) { throw new Error("Invalid response format from Fear and Greed API."); } return clean(data.data[0]); } catch (error: any) { throw new Error(`Failed to fetch Fear and Greed Index: ${error.message}`); } }, });

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/NaniDAO/agentek'

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