index.ts•2.15 kB
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { wrapToolHandler } from '../wrapToolHandler.js';
import type { MarketstackClient } from '../../marketstackClient.js';
import { listIndicesTool } from './listIndices.js';
import { getIndexInfoTool } from './getIndexInfo.js';
import { listBondsCountriesTool } from './listBondsCountries.js';
import { getBondInfoTool } from './getBondInfo.js';
import { listEtfTickersTool } from './listEtfTickers.js';
import { getEtfHoldingsTool } from './getEtfHoldings.js';
/**
* Registers Financial Instruments tools with the MCP server.
* @param server The McpServer instance.
* @param client The Marketstack client instance.
*/
export const registerFinancialInstrumentsTools = (server: McpServer, client: MarketstackClient): void => {
console.log('Registering Marketstack Financial Instruments tools...');
server.tool(
listIndicesTool.name,
listIndicesTool.description,
listIndicesTool.inputSchemaShape,
wrapToolHandler((input) => listIndicesTool.handler(input, client))
);
server.tool(
getIndexInfoTool.name,
getIndexInfoTool.description,
getIndexInfoTool.inputSchemaShape,
wrapToolHandler((input) => getIndexInfoTool.handler(input, client))
);
server.tool(
listBondsCountriesTool.name,
listBondsCountriesTool.description,
listBondsCountriesTool.inputSchemaShape,
wrapToolHandler((input) => listBondsCountriesTool.handler(input, client))
);
server.tool(
getBondInfoTool.name,
getBondInfoTool.description,
getBondInfoTool.inputSchemaShape,
wrapToolHandler((input) => getBondInfoTool.handler(input, client))
);
server.tool(
listEtfTickersTool.name,
listEtfTickersTool.description,
listEtfTickersTool.inputSchemaShape,
wrapToolHandler((input) => listEtfTickersTool.handler(input, client))
);
server.tool(
getEtfHoldingsTool.name,
getEtfHoldingsTool.description,
getEtfHoldingsTool.inputSchemaShape,
wrapToolHandler((input) => getEtfHoldingsTool.handler(input, client))
);
console.log('Finished registering Marketstack Financial Instruments tools.');
};