Skip to main content
Glama
BACH-AI-Tools

Finmap MCP Server

Sector performance

get_sectors_overview

Retrieve aggregated performance metrics by sector for specific stock exchanges on chosen dates to analyze market trends and sector performance.

Instructions

Get aggregated performance metrics by sector for an exchange on a specific date.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stockExchangeYesStock exchange: amex, nasdaq, nyse, us-all, lse, moex, bist, hkex
yearNo
monthNo
dayNo
sectorNoGet data for specific sector only

Implementation Reference

  • The asynchronous handler function that implements the core logic of the 'get_sectors_overview' tool. It fetches market data for the specified exchange and date, filters for sector entries, optionally filters by a specific sector, maps the data to a structured format, and returns a response with charts and metrics.
    async ({
    	stockExchange,
    	year,
    	month,
    	day,
    	sector,
    }: {
    	stockExchange: StockExchange;
    	year?: number;
    	month?: number;
    	day?: number;
    	sector?: string;
    }) => {
    	try {
    		const formattedDate = getDate(year, month, day);
    		const marketDataResponse = await fetchMarketData(
    			stockExchange,
    			formattedDate,
    		);
    
    		const sectors = marketDataResponse.securities.data
    			.filter(
    				(item: any) =>
    					item[INDICES.TYPE] === "sector" && item[INDICES.SECTOR] !== "",
    			)
    			.filter((item: any) => !sector || item[INDICES.TICKER] === sector)
    			.map((item: any) => ({
    				name: item[INDICES.TICKER],
    				marketCap: item[INDICES.MARKET_CAP],
    				marketCapChangePct: item[INDICES.PRICE_CHANGE_PCT],
    				volume: item[INDICES.VOLUME],
    				value: item[INDICES.VALUE],
    				numTrades: item[INDICES.NUM_TRADES],
    				itemsPerSector: item[INDICES.ITEMS_PER_SECTOR],
    			}));
    
    		return createResponse({
    			info: INFO,
    			charts: createCharts(stockExchange, formattedDate),
    			date: formattedDate,
    			exchange: stockExchange.toUpperCase(),
    			currency: EXCHANGE_INFO[stockExchange as StockExchange].currency,
    			sectors,
    		});
    	} catch (error) {
    		return createErrorResponse(error);
    	}
    },
  • The tool metadata including title, description, and inputSchema using Zod for validation of parameters: stockExchange (enum), optional date components (year, month, day), and optional sector string.
    {
    	title: "Sector performance",
    	description:
    		"Get aggregated performance metrics by sector for an exchange on a specific date.",
    	inputSchema: {
    		stockExchange: exchangeSchema,
    		...dateSchema,
    		sector: z
    			.string()
    			.optional()
    			.describe("Get data for specific sector only"),
    	},
    },
  • src/core.ts:548-611 (registration)
    The MCP server registration call for the 'get_sectors_overview' tool, including the tool name, schema/metadata, and handler function reference.
    server.registerTool(
    	"get_sectors_overview",
    	{
    		title: "Sector performance",
    		description:
    			"Get aggregated performance metrics by sector for an exchange on a specific date.",
    		inputSchema: {
    			stockExchange: exchangeSchema,
    			...dateSchema,
    			sector: z
    				.string()
    				.optional()
    				.describe("Get data for specific sector only"),
    		},
    	},
    	async ({
    		stockExchange,
    		year,
    		month,
    		day,
    		sector,
    	}: {
    		stockExchange: StockExchange;
    		year?: number;
    		month?: number;
    		day?: number;
    		sector?: string;
    	}) => {
    		try {
    			const formattedDate = getDate(year, month, day);
    			const marketDataResponse = await fetchMarketData(
    				stockExchange,
    				formattedDate,
    			);
    
    			const sectors = marketDataResponse.securities.data
    				.filter(
    					(item: any) =>
    						item[INDICES.TYPE] === "sector" && item[INDICES.SECTOR] !== "",
    				)
    				.filter((item: any) => !sector || item[INDICES.TICKER] === sector)
    				.map((item: any) => ({
    					name: item[INDICES.TICKER],
    					marketCap: item[INDICES.MARKET_CAP],
    					marketCapChangePct: item[INDICES.PRICE_CHANGE_PCT],
    					volume: item[INDICES.VOLUME],
    					value: item[INDICES.VALUE],
    					numTrades: item[INDICES.NUM_TRADES],
    					itemsPerSector: item[INDICES.ITEMS_PER_SECTOR],
    				}));
    
    			return createResponse({
    				info: INFO,
    				charts: createCharts(stockExchange, formattedDate),
    				date: formattedDate,
    				exchange: stockExchange.toUpperCase(),
    				currency: EXCHANGE_INFO[stockExchange as StockExchange].currency,
    				sectors,
    			});
    		} catch (error) {
    			return createErrorResponse(error);
    		}
    	},
    );
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 what the tool does but doesn't describe output format, pagination, rate limits, authentication needs, or error conditions. For a tool with 5 parameters and no output schema, this leaves significant behavioral gaps.

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 functionality without unnecessary words. Every element ('Get aggregated performance metrics by sector for an exchange on a specific date') contributes directly to understanding the tool's purpose.

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 the complexity (5 parameters, no annotations, no output schema, low schema coverage), the description is incomplete. It doesn't explain what 'aggregated performance metrics' include, how sectors are defined, date handling for invalid combinations, or the return format. For a data retrieval tool with multiple parameters, more context is needed.

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 only 40%, but the description adds minimal parameter semantics beyond the schema. It implies 'stockExchange', 'year', 'month', 'day', and 'sector' parameters but doesn't explain their relationships or provide additional context like date validation or sector filtering behavior. The description partially compensates but not sufficiently for the low coverage.

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 ('aggregated performance metrics by sector') with specific context ('for an exchange on a specific date'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_market_overview' or 'list_sectors', which could provide similar sector-related data.

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_market_overview' or 'list_sectors'. It mentions the context (exchange and date) but doesn't specify prerequisites, exclusions, or comparative use cases with sibling tools.

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/BACH-AI-Tools/bach-finmap-mcp'

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