Skip to main content
Glama

get_twap_latest

Retrieve time-weighted average prices from Pyth Network's decentralized oracle for specified assets using a custom time window, enabling accurate price calculations for trading and analysis.

Instructions

Get the latest time-weighted average price (TWAP) from Pyth Network with a custom time window

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
window_secondsYesTime window in seconds (1-600). Example: 300 for 5-minute TWAP
idsYesList of price feed IDs to get TWAP for
encodingNoEncoding type for binary data (default: hex)
parsedNoInclude calculated TWAP in parsed field (default: true)
ignore_invalid_price_idsNoIgnore invalid price IDs (default: false)
include_binaryNoInclude binary proof data (default: false)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool gets TWAP data but doesn't describe what the output looks like (e.g., format, structure), error handling, rate limits, authentication needs, or whether it's a read-only operation. The mention of 'custom time window' hints at configuration but lacks operational details.

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 a single, efficient sentence that front-loads the core purpose ('Get the latest TWAP') and adds necessary context ('from Pyth Network with a custom time window'). There's no wasted verbiage or redundancy.

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

Completeness2/5

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

For a tool with 6 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain the return format, error conditions, or how the TWAP is calculated (e.g., over what time period 'latest' refers to). The lack of behavioral context and output information leaves significant gaps for an agent to use this tool effectively.

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%, so parameters are fully documented in the schema. The description doesn't add any semantic information beyond what's in the schema (e.g., it doesn't explain why window_seconds is limited to 1-600 or how TWAP calculation works with multiple ids). Baseline 3 is appropriate since the schema does the heavy lifting.

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 verb 'Get' and resource 'latest time-weighted average price (TWAP) from Pyth Network', specifying the action and data source. It mentions 'custom time window' which adds specificity, but doesn't explicitly differentiate from sibling tools like get_latest_price_updates or get_price_feeds beyond the TWAP calculation aspect.

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 tool versus alternatives like get_latest_price_updates or get_price_feeds. It mentions a 'custom time window' but doesn't explain why one would choose TWAP over other price data methods, nor does it specify prerequisites or exclusions.

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/itsOmSarraf/pyth-network-mcp'

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