Skip to main content
Glama

get_dex_price

Fetch current Uniswap V3 spot prices on Base mainnet for trading pairs like ETH/USDC. Returns price, pool details, and token symbols with 30-second caching.

Instructions

Fetch the current spot price for a Uniswap V3 trading pair on Base mainnet. Reads sqrtPriceX96 from the pool contract's slot0() function and converts to a human-readable price. Returns price (token1 per token0), pool address, fee tier, token symbols, network, and cache status. Prices are cached for 30 seconds — the 'cached' field in the response indicates whether the result came from cache. Free tier — no payment required in standalone mode; $0.01 USDC via x402 on the resource server. Use list_trading_pairs first to discover available pairs and their token ordering.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pairYesTrading pair identifier (e.g. 'ETH/USDC'). Use list_trading_pairs to see all available options with pool addresses and fee tiers. Each pair returns the price of token0 denominated in token1 (e.g. ETH/USDC returns USDC per 1 ETH, cbETH/WETH returns WETH per 1 cbETH). Available: ETH/USDC, ETH/USDT, WETH/DAI, USDC/USDbC, cbETH/WETH.
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key traits: the tool reads from a contract slot and converts data, caches prices for 30 seconds (with a 'cached' field), and includes cost details (free in standalone mode, paid via x402). However, it doesn't mention error handling, rate limits, or authentication requirements, leaving some gaps for a mutation-free but network-dependent tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the core function and following with details like caching, cost, and usage guidance. Every sentence adds value (e.g., cache duration, payment options, sibling tool reference), but it could be slightly more streamlined by integrating the token ordering explanation more tightly with the pair parameter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (fetching and converting on-chain data), no annotations, and no output schema, the description does well by covering purpose, usage, behavioral traits (caching, cost), and parameter semantics. However, it lacks details on error cases (e.g., invalid pair handling) and the exact structure of the return data, which would be helpful for an agent to interpret results fully.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage, so the baseline is 3. The description adds value by explaining the token ordering semantics: 'Each pair returns the price of token0 denominated in token1 (e.g., ETH/USDC returns USDC per 1 ETH).' This clarifies the meaning beyond the enum list, though it doesn't detail the pair format or validation rules beyond what's implied.

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 tool's purpose with specific verbs ('Fetch', 'Reads', 'converts', 'Returns') and resources ('current spot price for a Uniswap V3 trading pair on Base mainnet'), distinguishing it from siblings like list_trading_pairs (discovery) or get_pool_liquidity (different data). It explicitly mentions what it returns (price, pool address, etc.), making the function unambiguous.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool vs. alternatives: 'Use list_trading_pairs first to discover available pairs and their token ordering.' It also clarifies the context (Base mainnet, Uniswap V3) and includes cost information (free tier vs. $0.01 USDC via x402), which helps the agent decide based on operational needs.

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/yeick010/agentshield-mcp'

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