Skip to main content
Glama
JCF0

CG Alpha MCP

by JCF0

elfa_query

Read-only

Query ELFA sentiment and trending token data via API calls to support crypto market analysis with technical indicators.

Instructions

Generic ELFA proxy. Call any ELFA path with method/query/body. Returns JSON.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesELFA path like /v2/...
methodNoHTTP method
queryNoQuery params map
bodyNoJSON body for non-GET

Implementation Reference

  • The primary handler function for the 'elfa_query' tool. It validates the input path, constructs the request options, calls the elfaFetch helper to perform the HTTP request to the ELFA API, handles progress notifications, and returns the response or error.
    "elfa_query": async (args, meta) => {
      const path = args && args.path;
      if (!path || typeof path !== "string") return { content: textContent({ error:true, message:"Missing required 'path' (string)" }), isError:true };
      const method = (args.method || "GET").toUpperCase();
      const query  = args.query || undefined;
      const body   = args.body  || undefined;
      progressNotify(meta && meta.progressToken, 1, 3, "Calling ELFA");
      const { ok, status, data } = await elfaFetch(path, { method, query, body });
      progressNotify(meta && meta.progressToken, 2, 3, "Formatting result");
      if (!ok) return { content: textContent({ error:true, status, data }), isError:true, _meta:{ status } };
      progressNotify(meta && meta.progressToken, 3, 3, "Done");
      return { content: textContent({ ok:true, status, data }) };
    },
  • mcp-server.js:286-295 (registration)
    The tool registration entry in the 'tools' array, which defines the name, description, input schema, and annotations for the 'elfa_query' tool. This is returned by the tools/list method.
    { name:"elfa_query",
      description:"Generic ELFA proxy. Call any ELFA path with method/query/body. Returns JSON.",
      inputSchema:{ type:"object", properties:{
        path:{type:"string", description:"ELFA path like /v2/..."},
        method:{type:"string", description:"HTTP method"},
        query:{type:"object", description:"Query params map"},
        body:{type:"object", description:"JSON body for non-GET"}
      }, required:["path"] },
      annotations:{ title:"ELFA: Generic Query", readOnlyHint:true, openWorldHint:true }
    },
  • The input schema definition for the 'elfa_query' tool, specifying the expected parameters: path (required string), method (string), query (object), body (object).
    inputSchema:{ type:"object", properties:{
      path:{type:"string", description:"ELFA path like /v2/..."},
      method:{type:"string", description:"HTTP method"},
      query:{type:"object", description:"Query params map"},
      body:{type:"object", description:"JSON body for non-GET"}
    }, required:["path"] },
  • Core helper function that executes the fetch request to the ELFA API base URL, applies authentication headers, handles query parameters and body serialization, parses JSON response, and returns structured result with ok/status/data.
    async function elfaFetch(pathname, options){
      const o = options || {};
      const method = (o.method || "GET").toUpperCase();
      const query = o.query || null;
      const body  = o.body  || null;
    
      const url = new URL(pathname, ELFA_BASE);
      if (query && typeof query === "object") {
        for (const k of Object.keys(query)) {
          const v = query[k];
          if (v !== undefined && v !== null) url.searchParams.set(k, String(v));
        }
      }
    
      const headers = { "Accept": "application/json" };
      applyAuth(headers);
      if (body && method !== "GET") headers["Content-Type"] = "application/json";
    
      const res = await fetch(url, { method, headers, body: body && method !== "GET" ? JSON.stringify(body) : undefined });
      const raw = await res.text();
      let data; try { data = raw ? JSON.parse(raw) : null; } catch { data = { raw }; }
      return { ok: res.ok, status: res.status, data };
    }
  • Helper function to apply ELFA authentication to request headers, using configurable header name and scheme.
    function applyAuth(headers){
      const h = ELFA_AUTH || {};
      if (!h.key) return headers;
      const name = (h.headerName || "x-elfa-api-key");
      headers[name] = h.scheme ? `${h.scheme} ${h.key}` : h.key; // empty scheme for ELFA
      return headers;
    }
Behavior3/5

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

Annotations indicate readOnlyHint=true and openWorldHint=true, suggesting safe read operations with flexible endpoints. The description adds context by specifying it's a 'proxy' that returns JSON, but doesn't elaborate on behavioral traits like error handling, authentication needs (implied by ELFA context), rate limits, or what 'any ELFA path' entails. It doesn't contradict annotations, but adds minimal value beyond them.

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 extremely concise with two sentences that efficiently convey core functionality: it's a generic proxy for ELFA calls and returns JSON. Every word earns its place, and it's front-loaded with the main purpose. No unnecessary details or redundancy.

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's complexity (generic proxy with 4 parameters, no output schema, and annotations covering safety), the description is minimally adequate. It explains what the tool does but lacks details on ELFA system context, error responses, or usage examples. With openWorldHint=true, more guidance on endpoint discovery would be helpful, but the description doesn't provide it.

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 description coverage is 100%, with clear descriptions for all 4 parameters (path, method, query, body). The description adds that path is 'like /v2/...' and body is 'for non-GET,' providing slight additional context. However, it doesn't explain parameter interactions (e.g., when query/body are required) or ELFA-specific semantics, so it meets the baseline for high schema coverage.

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 tool's purpose as a 'Generic ELFA proxy' that can 'Call any ELFA path with method/query/body' and 'Returns JSON.' This specifies the verb (call/proxy), resource (ELFA paths), and output format. However, it doesn't explicitly differentiate from sibling tools like elfa_keyword_mentions or elfa_trending, which appear to be more specific ELFA operations.

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 no guidance on when to use this generic proxy tool versus the more specific sibling tools (e.g., elfa_keyword_mentions, elfa_trending). It mentions it can call 'any ELFA path,' but doesn't specify contexts where this generic approach is preferred over dedicated tools or when it might be inappropriate. No alternatives or exclusions are mentioned.

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/JCF0/cg-alpha-mcp'

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