Skip to main content
Glama

get_markets

Retrieve a comprehensive list of available trading markets with detailed symbol information for cryptocurrency trading analysis and decision-making.

Instructions

List all available trading markets with their symbol info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'get_markets' tool handler - calls the API endpoint '/markets' to retrieve all available trading markets and returns the data as JSON text. Takes no input parameters.
    // Tool: get_markets
    server.tool(
      "get_markets",
      "List all available trading markets with their symbol info.",
      {},
      async () => {
        const data = await apiGet<unknown[]>("/markets");
        return {
          content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
        };
      }
    );
  • Helper function used by get_markets to make authenticated GET requests to the API. Constructs the full URL from API_BASE and path, adds auth headers, and parses the JSON response.
    async function apiGet<T>(path: string): Promise<T> {
      const res = await fetch(`${API_BASE}${path}`, {
        headers: getAuthHeaders(),
      });
      if (!res.ok) {
        const text = await res.text();
        throw new Error(`API GET ${path} failed (${res.status}): ${text}`);
      }
      return res.json() as Promise<T>;
    }

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/mikusnuz/pexbot-mcp'

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