Skip to main content
Glama
yantrix-ai

@praveen030686/data-apis-mcp

Get Forex Rate

finance_forex_rate
Read-onlyIdempotent

Retrieve foreign exchange rates between currency pairs with 5-day historical data to support financial analysis and currency conversion decisions.

Instructions

Get foreign exchange rate between two currencies with 5-day history. Costs $0.01 USDC per request via x402 on Base. Format: FROM-TO (e.g., USD-EUR, GBP-JPY, EUR-INR)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pairYesCurrency pair in FROM-TO format (e.g., USD-EUR, GBP-JPY)

Implementation Reference

  • The tool "finance_forex_rate" is registered here with its schema and handler implementation. It uses a helper 'apiFetch' to call a finance API endpoint.
    server.registerTool(
      "finance_forex_rate",
      {
        title: "Get Forex Rate",
        description: `Get foreign exchange rate between two currencies with 5-day history.
    Costs $0.01 USDC per request via x402 on Base.
    Format: FROM-TO (e.g., USD-EUR, GBP-JPY, EUR-INR)`,
        inputSchema: {
          pair: z.string().min(5).max(10).describe("Currency pair in FROM-TO format (e.g., USD-EUR, GBP-JPY)"),
        },
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
      },
      async ({ pair }) => {
        const data = await apiFetch(`${FINANCE_API}/api/v1/forex/rate/${pair.toUpperCase()}`);
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      }
    );
Behavior4/5

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

The description adds valuable behavioral context beyond annotations: it discloses the cost ('Costs $0.01 USDC per request via x402 on Base') and the 5-day history feature. Annotations already cover read-only, open-world, idempotent, and non-destructive traits, so the description effectively supplements with operational details without contradiction.

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 highly concise and well-structured, with three sentences that each serve a clear purpose: stating the tool's function, disclosing cost and method, and explaining parameter format. There is no wasted text, and information is front-loaded effectively.

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 (single parameter, no output schema), the description is mostly complete. It covers purpose, cost, and parameter format, but lacks details on output (e.g., what data is returned in the 5-day history) and error handling, which could be useful for an agent despite the absence of an output schema.

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?

The description adds some parameter semantics by explaining the format ('FROM-TO') and providing examples ('e.g., USD-EUR, GBP-JPY, EUR-INR'), which clarifies usage. However, the input schema already has 100% description coverage for the 'pair' parameter, so the description does not significantly enhance beyond what the schema provides, aligning with the baseline for high schema coverage.

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: 'Get foreign exchange rate between two currencies with 5-day history.' It specifies the verb ('Get'), resource ('foreign exchange rate'), and scope ('5-day history'), and distinguishes it from sibling tools like 'finance_forex_convert' by focusing on rates rather than conversion.

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

Usage Guidelines4/5

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

The description provides clear context for usage by mentioning the 5-day history and cost per request, which helps determine when to use it. However, it does not explicitly state when to use this tool versus alternatives like 'finance_forex_convert' or other finance tools, nor does it provide exclusions or prerequisites.

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/yantrix-ai/x402-apis-mcp-server'

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