Skip to main content
Glama
BACH-AI-Tools

Finmap MCP Server

List sectors

list_sectors

Retrieve business sectors for a specific stock exchange on a given date, including item counts for financial analysis.

Instructions

List available business sectors for an exchange on a specific date, including item counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stockExchangeYesStock exchange: amex, nasdaq, nyse, us-all, lse, moex, bist, hkex
yearNo
monthNo
dayNo

Implementation Reference

  • src/core.ts:275-324 (registration)
    Registration of the 'list_sectors' tool using server.registerTool, including title, description, input schema, and handler function.
    server.registerTool(
    	"list_sectors",
    	{
    		title: "List sectors",
    		description:
    			"List available business sectors for an exchange on a specific date, including item counts.",
    		inputSchema: { stockExchange: exchangeSchema, ...dateSchema },
    	},
    	async ({
    		stockExchange,
    		year,
    		month,
    		day,
    	}: {
    		stockExchange: StockExchange;
    		year?: number;
    		month?: number;
    		day?: number;
    	}) => {
    		try {
    			const formattedDate = getDate(year, month, day);
    			const marketDataResponse = await fetchMarketData(
    				stockExchange,
    				formattedDate,
    			);
    
    			const sectorCounts: Record<string, number> = {};
    			marketDataResponse.securities.data.forEach((item: any[]) => {
    				if (item[INDICES.TYPE] !== "sector" && item[INDICES.SECTOR]) {
    					sectorCounts[item[INDICES.SECTOR]] =
    						(sectorCounts[item[INDICES.SECTOR]] || 0) + 1;
    				}
    			});
    
    			const sectors = Object.entries(sectorCounts).map(([name, count]) => ({
    				name,
    				itemsPerSector: count,
    			}));
    			return createResponse({
    				info: INFO,
    				date: formattedDate,
    				exchange: stockExchange.toUpperCase(),
    				currency: EXCHANGE_INFO[stockExchange as StockExchange].currency,
    				sectors,
    			});
    		} catch (error) {
    			return createErrorResponse(error);
    		}
    	},
    );
  • The handler function that fetches market data for the given exchange and date, counts the number of items per sector, and returns a list of sectors with their item counts.
    async ({
    	stockExchange,
    	year,
    	month,
    	day,
    }: {
    	stockExchange: StockExchange;
    	year?: number;
    	month?: number;
    	day?: number;
    }) => {
    	try {
    		const formattedDate = getDate(year, month, day);
    		const marketDataResponse = await fetchMarketData(
    			stockExchange,
    			formattedDate,
    		);
    
    		const sectorCounts: Record<string, number> = {};
    		marketDataResponse.securities.data.forEach((item: any[]) => {
    			if (item[INDICES.TYPE] !== "sector" && item[INDICES.SECTOR]) {
    				sectorCounts[item[INDICES.SECTOR]] =
    					(sectorCounts[item[INDICES.SECTOR]] || 0) + 1;
    			}
    		});
    
    		const sectors = Object.entries(sectorCounts).map(([name, count]) => ({
    			name,
    			itemsPerSector: count,
    		}));
    		return createResponse({
    			info: INFO,
    			date: formattedDate,
    			exchange: stockExchange.toUpperCase(),
    			currency: EXCHANGE_INFO[stockExchange as StockExchange].currency,
    			sectors,
    		});
    	} catch (error) {
    		return createErrorResponse(error);
    	}
    },
  • Input schema definition for the 'list_sectors' tool, including title, description, and Zod-based input schema referencing exchangeSchema and dateSchema.
    {
    	title: "List sectors",
    	description:
    		"List available business sectors for an exchange on a specific date, including item counts.",
    	inputSchema: { stockExchange: exchangeSchema, ...dateSchema },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the action ('List available business sectors') and output detail ('including item counts'), but lacks information on permissions, rate limits, pagination, error handling, or data freshness. For a tool with 4 parameters and no annotation coverage, this is a significant gap in behavioral 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, well-structured sentence that efficiently conveys the tool's purpose and key output detail ('including item counts'). It is front-loaded with essential information and has no wasted words, making it easy for an agent 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 the tool's complexity (4 parameters, low schema coverage, no annotations, no output schema), the description is incomplete. It adequately states the purpose but lacks usage guidelines, detailed parameter explanations, behavioral traits, and output format information. For a tool that likely returns structured sector data, more context is needed to help the agent use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is low at 25%, with only 'stockExchange' having a description. The description mentions 'for an exchange on a specific date', which hints at the purpose of 'stockExchange', 'year', 'month', and 'day' parameters, but does not explain their semantics, constraints, or interactions beyond what the schema minimally provides. It fails to compensate for the low coverage, leaving most parameters under-documented.

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 ('List') and resource ('available business sectors'), specifies the context ('for an exchange on a specific date'), and includes additional detail ('including item counts'). It distinguishes from siblings like 'get_sectors_overview' by focusing on listing with date-specific counts, though the distinction could be more 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 like 'get_sectors_overview' or 'list_exchanges'. It mentions the context ('for an exchange on a specific date') but lacks explicit when-to-use or when-not-to-use instructions, leaving the agent to infer usage based on parameter requirements.

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