Skip to main content
Glama
matteoantoci

Marketstack MCP Server

by matteoantoci

list_currencies

Retrieve a list of all currencies supported by the Marketstack API, with options to paginate results using limit and offset parameters for efficient data access.

Instructions

Look up all currencies supported by the marketstack API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoSpecify a pagination limit (number of results per page) for your API request. Default limit value is `100`, maximum allowed limit value is `1000`.
offsetNoSpecify a pagination offset value for your API request. Example: An offset value of `100` combined with a limit value of 10 would show results 100-110. Default value is `0`, starting with the first available result.

Implementation Reference

  • The main handler function for the 'list_currencies' tool. It extracts limit and offset from input, constructs API params for the 'currencies' endpoint, fetches data using the Marketstack client, and returns the data or throws an error.
    const listCurrenciesHandler = async (input: Input, client: MarketstackClient): Promise<Output> => {
      try {
        const { limit, offset } = input;
    
        const apiRequestParams: MarketstackApiParams = {
          endpoint: 'currencies',
          ...(limit && { limit }), // Include if limit is provided
          ...(offset && { offset }), // Include if offset is provided
        };
    
        const data = await client.fetchApiData(apiRequestParams);
    
        return data;
      } catch (error: unknown) {
        console.error('listCurrencies tool error:', error);
        const message = error instanceof Error ? error.message : 'An unknown error occurred.';
        throw new Error(`listCurrencies tool failed: ${message}`);
      }
    };
  • Zod input schema shape defining optional 'limit' (1-1000, default 100) and 'offset' (min 0, default 0) parameters with descriptions.
    const listCurrenciesInputSchemaShape = {
      limit: z
        .number()
        .int()
        .min(1)
        .max(1000)
        .optional()
        .default(100)
        .describe(
          'Specify a pagination limit (number of results per page) for your API request. Default limit value is `100`, maximum allowed limit value is `1000`.'
        ),
      offset: z
        .number()
        .int()
        .min(0)
        .optional()
        .default(0)
        .describe(
          'Specify a pagination offset value for your API request. Example: An offset value of `100` combined with a limit value of 10 would show results 100-110. Default value is `0`, starting with the first available result.'
        ),
    };
  • MCP server registration of the 'list_currencies' tool using server.tool(), referencing the tool definition's name, description, schema, and wrapped handler.
    server.tool(
      listCurrenciesTool.name,
      listCurrenciesTool.description,
      listCurrenciesTool.inputSchemaShape,
      wrapToolHandler((input) => listCurrenciesTool.handler(input, client))
    );
  • Tool definition object exporting the 'list_currencies' tool with its name, description, input schema, and handler for use in registration.
    export const listCurrenciesTool: MarketstackToolDefinition = {
      name: 'list_currencies',
      description: 'Look up all currencies supported by the marketstack API.',
      inputSchemaShape: listCurrenciesInputSchemaShape,
      handler: listCurrenciesHandler,
    };
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'looks up' currencies without disclosing behavioral traits. It doesn't mention that this is a read-only API call, potential rate limits, authentication needs, response format, or whether it returns paginated results. The description is minimal and lacks critical operational context.

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 directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with zero waste, making it easy to parse quickly.

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?

Given no annotations, no output schema, and a simple read operation with two parameters, the description is incomplete. It doesn't explain what the return values look like (e.g., list of currency codes with names), how results are structured, or any error conditions. For a tool that fetches data, more context is needed to use it 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 the schema fully documents the 'limit' and 'offset' parameters with defaults and constraints. The description adds no parameter information beyond what the schema provides, meeting the baseline score of 3 for high schema coverage without additional value.

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 'look up' and resource 'all currencies supported by the marketstack API', making the purpose specific and understandable. It doesn't explicitly differentiate from sibling tools like 'list_exchanges' or 'list_tickers', but since those list different resources, the distinction is implicit rather than explicit.

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. It doesn't mention prerequisites, context for currency data, or how it relates to sibling tools like 'get_ticker_details' that might involve currencies. Usage is implied by the name and purpose but not explicitly stated.

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

Related 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/matteoantoci/mcp-marketstack'

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