Skip to main content
Glama

Marketstack MCP Server

by matteoantoci

list_bonds_countries

Retrieve a list of supported countries for bond data with pagination options. Access financial market information via the Marketstack MCP Server.

Instructions

List all supported countries for bond data.

Input 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.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "limit": { "default": 100, "description": "Specify a pagination limit (number of results per page) for your API request. Default limit value is `100`, maximum allowed limit value is `1000`.", "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "default": 0, "description": "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.", "minimum": 0, "type": "integer" } }, "type": "object" }

Implementation Reference

  • The handler function that implements the core logic of the 'list_bonds_countries' tool, making an API call to the Marketstack 'bonds' endpoint with pagination parameters.
    const listBondsCountriesHandler = async (input: Input, client: MarketstackClient): Promise<Output> => { try { const { limit, offset } = input; // Assuming the endpoint for listing bond countries is 'bonds' or 'bondslist' // The documentation is slightly ambiguous, using 'bond' for details // and showing a listing response structure without a clear endpoint path. // We'll try 'bonds' first based on the 'bond' example. const endpoint = 'bonds'; const apiRequestParams: MarketstackApiParams = { endpoint, ...(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('listBondsCountries tool error:', error); const message = error instanceof Error ? error.message : 'An unknown error occurred.'; throw new Error(`listBondsCountries tool failed: ${message}`); } };
  • Zod input schema definition for the 'list_bonds_countries' tool, defining optional limit and offset parameters with validation and descriptions.
    const listBondsCountriesInputSchemaShape = { 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.' ), };
  • Registration of the 'list_bonds_countries' tool on the MCP server using server.tool() with wrapped handler.
    server.tool( listBondsCountriesTool.name, listBondsCountriesTool.description, listBondsCountriesTool.inputSchemaShape, wrapToolHandler((input) => listBondsCountriesTool.handler(input, client)) );

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