Skip to main content
Glama
piquesignal

Pique Signal

Official

get_price

Read-onlyIdempotent

Retrieve the current price of any Solana token in SOL. Checks Jupiter first, then falls back to DexScreener for accuracy.

Instructions

Get the current price of any Solana token in SOL. Checks Jupiter first, falls back to DexScreener.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mintYesSolana token mint address

Implementation Reference

  • The handler function for the 'get_price' tool. Calls fetchPrice(mint) and returns the result as JSON text, or a 'no price data' message if null.
    async ({ mint }) => {
      try {
        const result = await fetchPrice(mint);
        if (!result.price) {
          return text(`No price data found for ${mint.slice(0, 8)}...`);
        }
        return text(JSON.stringify(result, null, 2));
      } catch (err) {
        return error(err.message);
      }
    }
  • Input schema for the 'get_price' tool: requires a 'mint' parameter validated by MINT_REGEX regex.
    {
      mint: z.string().regex(MINT_REGEX)
        .describe('Solana token mint address'),
    },
  • src/tools.js:247-272 (registration)
    Registration of the 'get_price' tool via server.tool(), with description, input schema, and handler.
    server.tool(
      'get_price',
      'Get the current price of any Solana token in SOL. Checks Jupiter first, falls back to DexScreener.',
      {
        mint: z.string().regex(MINT_REGEX)
          .describe('Solana token mint address'),
      },
      {
        title: 'Get Price',
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false,
      },
      async ({ mint }) => {
        try {
          const result = await fetchPrice(mint);
          if (!result.price) {
            return text(`No price data found for ${mint.slice(0, 8)}...`);
          }
          return text(JSON.stringify(result, null, 2));
        } catch (err) {
          return error(err.message);
        }
      }
    );
  • The fetchPrice() helper function that queries Jupiter API first, then falls back to DexScreener API.
    async function fetchPrice(mint) {
      try {
        const res = await fetch(
          `https://api.jup.ag/price/v2?ids=${encodeURIComponent(mint)}&vsToken=${SOL_MINT}`,
          { signal: AbortSignal.timeout(PRICE_TIMEOUT_MS) }
        );
        if (res.ok) {
          const data = await res.json();
          const p = data.data?.[mint]?.price;
          if (p) return { mint, price: parseFloat(p), source: 'jupiter' };
        }
      } catch {}
      try {
        const res = await fetch(
          `https://api.dexscreener.com/latest/dex/tokens/${encodeURIComponent(mint)}`,
          { signal: AbortSignal.timeout(PRICE_TIMEOUT_MS) }
        );
        if (res.ok) {
          const data = await res.json();
          const pair = data.pairs?.find(p => p.chainId === 'solana' && p.quoteToken?.symbol === 'SOL');
          if (pair?.priceNative) return { mint, price: parseFloat(pair.priceNative), source: 'dexscreener' };
          const any = data.pairs?.[0];
          if (any?.priceNative) return { mint, price: parseFloat(any.priceNative), source: 'dexscreener' };
        }
      } catch {}
      return { mint, price: null, source: null };
    }
  • MINT_REGEX constant used for validating Solana mint addresses in the input schema.
    const MINT_REGEX = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
Behavior4/5

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

Annotations already indicate read-only, non-destructive, idempotent behavior. The description adds the fallback order (Jupiter first, then DexScreener), which is useful behavioral context beyond annotations.

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?

Two sentences, no wasted words, front-loaded with purpose and fallback detail. Highly concise and well-structured.

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?

The tool is simple with one parameter and no output schema. The description omits the return format (e.g., number, object with source), which would be helpful for an agent. Adequate but not complete.

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?

Input schema has 100% coverage with a description for the only parameter 'mint'. The description adds no additional parameter semantics beyond what the schema already provides, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'current price of any Solana token in SOL', which is distinct from sibling tools that deal with portfolio, positions, signals, and trading.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions the fallback mechanism (Jupiter then DexScreener) but provides no explicit guidance on when to use this tool over alternatives or when not to use it. Usage is implied by sibling uniqueness.

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/piquesignal/piquesignal-mcp'

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